Ask coding questions

← Back to all posts
How do I do this???
THEGOLDENTHRONE

How do I return a random value for my location, then be able to move to another location, return a new value for that location, then move back to my original location and return the original value, and so on, returning a new value for each new location, and returning the previously generated values for the old locations? By the way, the code is in python.

Answered by MrVoo [earned 5 cycles]
View Answer
Voters
THEGOLDENTHRONE
Comments
hotnewtop
MrVoo

What do you mean by location?

THEGOLDENTHRONE

I mean imaginary location, it generates a random value, then I input a command like 'left' and it repeats, and remembers the locations already generated.

MrVoo

@THEGOLDENTHRONE Is this what you need?

THEGOLDENTHRONE

Yes! thank you, that is exactly what I need. While it doesn't contain all of the code I need, it has most of it, and I can easily modify this to make it work for what I want it to do. Thanks!