de en es fr
Let the machine help
Light teasing, exhibition, BDSM, sissyfication, watersports... with sounds and pictures


Post new topic Reply to topic  [ 3 posts ] 
Author Message
 Multiply a Result
PostPosted: Fri Jan 17, 2025 2:22 am 
Offline
Regular
If I am using:

def score = getInteger(“How many questions did you miss?”,0);

If I want to have the program multiply that number by 10 and then use that number in:

show(“That is going to cost you (score x 10) strokes.”);

How would I write that out in Groovy??

Thanks.


Top
 Profile Send private message 
 
 Re: Multiply a Result
PostPosted: Fri Jan 17, 2025 11:03 am 
Offline
Veteran
User avatar
You can add things including strings together with the + symbol and multiply the number with the * symbol, so the following will display what you want...

show(“That is going to cost you" + (score * 10) + " strokes.”);


Top
 Profile Send private message 
 
 Re: Multiply a Result
PostPosted: Fri Jan 17, 2025 8:51 pm 
Offline
Regular
Thank you! It worked perfectly.


Top
 Profile Send private message 
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 3 posts ] 

All times are UTC + 1 hour [ DST ]


Who is online

Users browsing this forum: No registered users and 3 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  


cron
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
Maroon Fusion theme created by Oxydo
Software, theme modifications, phpBB modification by Doti 2010 - 2020
This website uses session cookies only.