Hi everyone, this is my first post, so i want to say thanks to MIT and YOU, Reader, for this!
Well, i need the following. I am writing a code for a "parody" of WWTBAM (Who Wants to be a Millionaire), and i can't do the 50/50 Lifeline...
I need a code that takes four numbers (answers) and chooses two of them to dissapear (they can't be the correct answer, which i added as a TruthFactor variable). So, i need the computer to choose two of 1-2-3-4 numbers, NEVER choosing the TruthFactor.
Thanks for your help,
Danieltatis (Daniel Charry)
Offline
repeat until <not < (myPick) = (TruthFactor) >> set [myPick v] to (pick random (1) to (4) ) end repeat until <not < (myOtherPick) = (TruthFactor) >> set [myOtherPick v] to (pick random (1) to (4) ) endYou'll need to fix the second repeat to also reject where myPick = myOtherPick. I'd show that but the scratch blocks code doesn't work.
Last edited by BoltBait (2012-09-17 22:01:12)
Offline
Danieltatis wrote:
Hi everyone, this is my first post, so i want to say thanks to MIT and YOU, Reader, for this!
Well, i need the following. I am writing a code for a "parody" of WWTBAM (Who Wants to be a Millionaire), and i can't do the 50/50 Lifeline...
I need a code that takes four numbers (answers) and chooses two of them to dissapear (they can't be the correct answer, which i added as a TruthFactor variable). So, i need the computer to choose two of 1-2-3-4 numbers, NEVER choosing the TruthFactor.
Thanks for your help,
Danieltatis (Daniel Charry)
Well instead of storing the correct answer in a variable, store the wrong answers in the variable like this: Answer 2 is correct. Variable = 134; Answer 4 is correct. Variable = 123
etc.
Then use this:
set [wrong1 v] to (letter (pick random (1) to (3) ) of (Variable)) set [wrong2 v] to (letter (pick random (1) to (3) ) of (Variable)) repeat until <not <(wrong1) = (wrong2)>> set [wrong1 v] to (letter (pick random (1) to (3) ) of (Variable)) endThen delete the choices wrong1 and wrong2.
Offline
Put your answers (1 to 4) in a list, then delete the correct answer. Pick two random items from the list and delete them as well. Take the correct answer and the one left in the list and those are your two answers.
Offline
Thanks everyone for helping me!
Danieltatis
Offline