I want to incorporate a list for my tycoon game, but I do not know how. I tried a lot of ways and failed each time. How can I incorporate a list into my scratch.mit.edu cash tycoon game? I am thinking of having an investment feature but I do not know how to use a list for something like that. I attached an image of my current code: https://i.stack.imgur.com/xbjmo.png
Asked
Active
Viewed 145 times
2 Answers
1
have three lists:
- a list of all investment options(names)
- a list of their price incressis(the same order as the first list)
- a list on what investments you have(the names)
repeat every ? seconds:
now loop over the last list and based off of the item number of the first list add $ based off the second one

myrccar
- 85
- 1
- 9
-
Can you clarify what you mean by 1 and 2? – Janice En Apr 20 '22 at 20:53
-
the first and second list ^ – myrccar Apr 20 '22 at 22:09
-
Yeah, I am not sure how I would go about doing what you said for 1 and 2 and I do not quite understand what you mean. – Janice En Apr 22 '22 at 03:57
-
okay so in the start of the post i have a list of all the list's you need in you project – myrccar Apr 23 '22 at 02:55
0
Here's a simple way to write it (scratchblocks
format):
[scratchblocks]
forever
add (foo) to [list1 v]
...
add (foo1) to [list2 v]
...
add (foo2) to [list3 v]
...
end
[\scratchblocks]
Here's an image:
The foo
, foo1
, and foo2
operators here are defined as:
foo |
foo1 |
foo2 |
---|---|---|
Adding the list of all of the investment options that there are in your tycoon game | The list of their increasing prices (which would be in the same order as which foo is defined |
The list of the investments that you currently own (doesn't necessarily have to be in the same order as foo /foo1 ) |
Hope this helps!

CrSb0001
- 151
- 1
- 11