0

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

Janice En
  • 31
  • 4

2 Answers2

1

have three lists:

  1. a list of all investment options(names)
  2. a list of their price incressis(the same order as the first list)
  3. 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
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:

enter image description here

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