Pages: 1
Topic closed
I am new to scratch and am making a game. I have a list of countries:
Portugal, Spain, France. On of the country names comes up at the start of the
game and you click the country. Then I turn the country grey and replace the country name in the list with done. After that I want to randomly show one of the remaining 2 countries but I dont want to show done. So if the list is returning done
I want to keep it going until it shows a country. like item any of country isnt
suppose to equal done. Anyone got an idea how to code this? Thanks.
Offline
Not sure exactly what you're saying...but I think all you need to accomplish that is the "not" block in the operators.
Offline
What you can do instead of replacing their entry with "done" is to delete their entry altogether, then pick randomly from 1 to the length of the list. Not sure if this conflicts with or breaks any of your other scripts though.
Last edited by Kileymeister_test (2012-01-02 16:33:23)
Offline
I tried that but say france has index 3. when I delete portugal france moves down to index 2. It all shifts. and spain moves from 2 to 1. I will have a total of 38 countries once I figure this out and if I put done in there at least I know where each country
left is. Using not is an option but you cant just say not. I want to randomly pick an
item in the list and check to see if it isnt equal to done and if that is true I want to
return that item. I will store it in a variable called random. I tried various ways of
looping through it and it either did nothing, returned true or false, or just continued
cycling through and returning all the items in the list.
Offline
Thanks for your help guys I figured it out. I set my variable that holds the list item to
item pick random 1-3 of countries list
forever if random = done
set variable that holds the list item to item pick random 1-3 of countries list
Offline
Topic closed
Pages: 1