Closed bhudgeons closed 4 years ago
Implemented --speed to control the animation speed.
One more feature idea: command to change the color of the runner :)
Okay, here's a use case: You could build a program that creates 3 runners. Each of them are given a different color, then they go to a "starting line" and pause. Then they "race" around a "track". Some "potholes" (pauses that trigger on a random basis) make them race at different speeds. After some number of times around the track, the winner pauses for a while in a "winner's circle" (maybe after "announcing" its win with #) while the losers fall off the grid. Due to the random pauses along the track, it would be a different winner each time it ran.
Oh ... and stdin would let you do something like this: ircis file1.txt | ircis file2.txt
... runners communicating across executions. (Kind of funny that these are "use cases" ... none of this is particularly "useful" to me in any normal sense of that word.)
You might not believe it but the current color was selected looking at the color combinations and stuff. I actually wanted something greenish but it just didn't look good sadly.
A race is actually a really fun idea to implement with random pauses and random paths. Have to try that out! :smile:
Yeah... stdin is an interesting touch but doesn't seem worth the effort kinda.
@bhudgeons
:heavy_check_mark: Random number generator
:heavy_check_mark: Pauses for Runners
:heavy_check_mark: :checkered_flag: RACETRACK! :tada:
Check it out, added output in readme :)
Not sure which of these are worth doing, but here are some things I thought would be fun to add.
Send information to the first Runner via stdin. for example,
echo "someinfo" | ircis myprog.txt
would execute myprog.txt, but would start the first Runner with "someinfo" in the stack or in a variable?Program "jumps" -- put two numbers on the stack for (x, y), and then when you hit a character for the "jump" command, the Runner would jump to that location on the grid.
Pause command -- will pause the runner for the number of "ticks" indicated by the num on top of the stack.
Rnd command -- push a random number on top of the stack
Make timing configurable -- add a configuration option to specify the pace that the visualization HTML will "tick." (Purely cosmetic.)
Thoughts?