Skip to content

Instantly share code, notes, and snippets.

@darius
Created May 14, 2014 19:11
Show Gist options
  • Select an option

  • Save darius/a7a0f7d15a33eda061d4 to your computer and use it in GitHub Desktop.

Select an option

Save darius/a7a0f7d15a33eda061d4 to your computer and use it in GitHub Desktop.
http://wry.me/hacking/dequebot/demo.html
OK, not sure what to do next. Things I have in mind:
- Values on the left as a stack
- Primitives parameterized by those values
- bf<>
- +-*/~ (~ is reciprocal)
- = (how do we say 'less than'?)
- Digits push numbers, and we need ',' or ' ' to separate them
- Another bot
- Send messages to a bot, queued on its right
- Sense things in the environment
- Conditionals
- Probably we have multiple clauses for a subroutine,
each prefixed by the data that selects it.
- Editing a subroutine by driving around, live
- While live driving, we see where actions would take us.
- Or there's undo, duh.
- Transcript that can be copied into a subroutine.
The coding/interaction model now is incoherent: turtle primitives
happen instantly, subroutine calls get added to q and run if we're
currently 'playing'. Simpler would be if every command acted the same.
Which way?
* Go instantly.
(And step it at the current rate, if >1 step?)
* Add to q.
(What if you want to effectively fix-and-continue? I guess we can
hack something for that case, later.)
At least in the case where we're stopped, I think we need a cursor
for these insertions into q.
If appropriate, the command gets appended to transcript, too.
* When's appropriate?
If the command is *not* getting inserted where the transcript
would not replay the same.
Scenario, then: building a recursive program, say Sierpinski triangle.
You start with the general case.
size S:
size 1 - S size 1 - S size 1 - S
6 ~ right size forward 6 ~ right
0 S:
(skip)
and it blocks on S not defined; q stays populated. (Maybe we should
only send messages; there's no *call* stack? Just locals?) Let's start
again:
size S: size size 0 = T
size True T:
size False T: size 1 - S size 1 - S size 1 - S
6 ~ right size forward 6 ~ right
Match-conditionals + live driving + message queues would make this a
lot like ToonTalk.
So, what first? Note there's not a lot of hacking time before demos.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment