OSDev.org

The Place to Start for Operating System Developers
It is currently Fri Apr 19, 2024 5:09 pm

All times are UTC - 6 hours




Post new topic Reply to topic  [ 23 posts ]  Go to page 1, 2  Next
Author Message
 Post subject: Tacky Turtle 3D- randomly generated turing drawing machine
PostPosted: Thu Aug 28, 2014 11:04 am 
Offline
Member
Member
User avatar

Joined: Mon Jun 05, 2006 11:00 pm
Posts: 2293
Location: USA (and Australia)
I've made a simple toy called Tacky Turtle. Basically, it's a virtual machine that runs randomly generated programs (any combination of symbols is a valid program), and the program controls a turtle which leaves a trail behind it.

The program's memory is a 'tape' which you can see on the right of the screen.

Getting started is easy, click 'Play' and then 'Randomize'.

Here is video of it in action:


Download links:
* Linux (x86, x86_64): http://www.andrewalexanderprice.com/software/tackyturtle/tackyturtle_linux.zip
* Windows: http://www.andrewalexanderprice.com/software/tackyturtle/tackyturtle_win.zip
* Mac (x86, x86_64): http://www.andrewalexanderprice.com/software/tackyturtle/tackyturtle_mac.zip

* Unity web-player: http://www.andrewalexanderprice.com/software/tackyturtle/

UPDATE: Here's a newer 3d version: http://www.andrewalexanderprice.com/software/tackyturtle3d/

You can share any interesting programs by clicking 'Share' and copying the link. Clicking that link will load the web player with that program pre-loaded. On desktop versions, you can load links by pasting it into the 'Share' dialog and clicking 'Load'.

_________________
My OS is Perception.


Last edited by AndrewAPrice on Sat Sep 06, 2014 10:53 am, edited 3 times in total.

Top
 Profile  
 
 Post subject: Re: Tacky Turtle - randomly generated turing drawing machine
PostPosted: Fri Aug 29, 2014 4:39 pm 
Offline
Member
Member
User avatar

Joined: Mon Jun 05, 2006 11:00 pm
Posts: 2293
Location: USA (and Australia)
I've been thinking about making a 3D version of this. That would look cool :)

_________________
My OS is Perception.


Top
 Profile  
 
 Post subject: Re: Tacky Turtle - randomly generated turing drawing machine
PostPosted: Fri Aug 29, 2014 6:23 pm 
Offline
Member
Member
User avatar

Joined: Mon Mar 05, 2012 11:23 am
Posts: 616
Location: Germany
hehe just tried it out, generates some really cool figures
i like these circles that come up:
ImageImage
also its fun to see what happens when you just randomly change parts of the program :P
Image
could you somehow explain what each command means? yeah 3d mode would be awesome, too :D
nice job! :)

_________________
Ghost OS - GitHub


Top
 Profile  
 
 Post subject: Re: Tacky Turtle - randomly generated turing drawing machine
PostPosted: Fri Aug 29, 2014 6:34 pm 
Offline
Member
Member
User avatar

Joined: Mon Jun 05, 2006 11:00 pm
Posts: 2293
Location: USA (and Australia)
Thanks Max.

There is a command list if you click "help" but if I recall correctly the commands are:

( rotate 5 degrees left
) rotate 5 degrees right
^ walk forward
r toggle red
g toggle green
b toggle blue

< previous tape position
> next tape position
- decrease tape value
+ increase tape value
= skip n instructions (n = tape value)
* repeat next instruction n times (n = tape value)
? skip next instruction if n is 0 (n = tape value)

Every other symbol is ignored (but still takes a cycle!)

_________________
My OS is Perception.


Top
 Profile  
 
 Post subject: Re: Tacky Turtle - randomly generated turing drawing machine
PostPosted: Fri Aug 29, 2014 6:45 pm 
Offline
Member
Member
User avatar

Joined: Mon Mar 05, 2012 11:23 am
Posts: 616
Location: Germany
That "help" button was too small for my tired eyes. :D Thanks though, I'll play around a bit :P

_________________
Ghost OS - GitHub


Top
 Profile  
 
 Post subject: Re: Tacky Turtle - randomly generated turing drawing machine
PostPosted: Fri Aug 29, 2014 11:48 pm 
MessiahAndrw wrote:
Basically, it's a virtual machine that runs randomly generated programs

But why there is some regularity in every picture? It seems generated programs are not random. Or there is small random part which is repeated many times after some translation/rotation.


Top
  
 
 Post subject: Re: Tacky Turtle - randomly generated turing drawing machine
PostPosted: Sat Aug 30, 2014 6:02 am 
Offline
Member
Member
User avatar

Joined: Mon Mar 05, 2012 11:23 am
Posts: 616
Location: Germany
embryo wrote:
But why there is some regularity in every picture? It seems generated programs are not random. Or there is small random part which is repeated many times after some translation/rotation.
If a program is randomly generated, that doesn't mean it can't create a regular output. It is able to repeat, as some commands trigger the tape position, and once the last tape was reached it jumps back to the first.

_________________
Ghost OS - GitHub


Top
 Profile  
 
 Post subject: Re: Tacky Turtle - randomly generated turing drawing machine
PostPosted: Sun Aug 31, 2014 1:09 am 
max wrote:
It is able to repeat, as some commands trigger the tape position, and once the last tape was reached it jumps back to the first.

After random program ends the VM starts it again? Then why there are rotations and shifts every cycle? And all translations follow a circle pattern.

Randomness and regularity together are interesting area to explore, but understanding it is not a straight-forward process.


Top
  
 
 Post subject: Re: Tacky Turtle - randomly generated turing drawing machine
PostPosted: Sun Aug 31, 2014 12:01 pm 
Offline
Member
Member
User avatar

Joined: Mon Mar 05, 2012 11:23 am
Posts: 616
Location: Germany
embryo wrote:
And all translations follow a circle pattern.
No, the ones I took a screenshot of did, there are also some that don't. But that has a simple explanation: if the turtle moves always forward after each turn, and turns for example 10 times to the left, but 12 times to the right, it runs in a circle..

_________________
Ghost OS - GitHub


Top
 Profile  
 
 Post subject: Re: Tacky Turtle - randomly generated turing drawing machine
PostPosted: Sun Aug 31, 2014 10:12 pm 
Offline
Member
Member
User avatar

Joined: Mon Jun 05, 2006 11:00 pm
Posts: 2293
Location: USA (and Australia)
embryo wrote:
max wrote:
It is able to repeat, as some commands trigger the tape position, and once the last tape was reached it jumps back to the first.

After random program ends the VM starts it again? Then why there are rotations and shifts every cycle? And all translations follow a circle pattern.

Randomness and regularity together are interesting area to explore, but understanding it is not a straight-forward process.


Yes it runs again. Just what Max said, if it runs the same thing over and over again (move forward, rotate right) there's a high chance it'll produce a circular pattern. Not all do and if you play with the tool you will get programs that generate straight patterns, things that look like scan lines, junk, etc.

Also, there is a tape device (I am simulating a turing machine) that acts as memory, and that can influence the looping and pattern behaviour of programs.

_________________
My OS is Perception.


Top
 Profile  
 
 Post subject: Re: Tacky Turtle - randomly generated turing drawing machine
PostPosted: Mon Sep 01, 2014 2:01 am 
max wrote:
if the turtle moves always forward after each turn, and turns for example 10 times to the left, but 12 times to the right, it runs in a circle..

Yes, it's really simple. Thanks for explanation :)


Top
  
 
 Post subject: Re: Tacky Turtle - randomly generated turing drawing machine
PostPosted: Mon Sep 01, 2014 2:05 am 
MessiahAndrw wrote:
Not all do and if you play with the tool you will get programs that generate straight patterns, things that look like scan lines, junk, etc.

Also, there is a tape device (I am simulating a turing machine) that acts as memory, and that can influence the looping and pattern behaviour of programs.

Nice toy to discover random regularities or regular randomness :)


Top
  
 
 Post subject: Re: Tacky Turtle - randomly generated turing drawing machine
PostPosted: Tue Sep 02, 2014 1:58 am 
Offline
Member
Member
User avatar

Joined: Mon Mar 05, 2012 11:23 am
Posts: 616
Location: Germany
My new favorite :D

_________________
Ghost OS - GitHub


Top
 Profile  
 
 Post subject: Re: Tacky Turtle - randomly generated turing drawing machine
PostPosted: Thu Sep 04, 2014 7:41 pm 
Offline
Member
Member
User avatar

Joined: Mon Jun 05, 2006 11:00 pm
Posts: 2293
Location: USA (and Australia)
I've been thinking about how a 3D version would work, and if the camera angle was static (you can't rotate the image) it would be simple because I merely have to draw the lines when the turtle moves. However if I implement the ability to rotate the display (which you'd want to), I'd have to redraw it from the new angle. I don't want to store a list of drawn lines, because this could be drawing hundreds of thousands of lines a second, and we'd quickly run out of memory.

So I'm thinking I could either do a voxel approach, where the turtle draws into a 512x512x512 voxel grid. This would look pixelated when zoomed up close though. An alternative approach would simply be to clear the display when you rotate, requiring the turtle to redraw.

Or, I could do a hybrid approach. Voxelize it into a low res (maybe 8x8x8) cloud that is only visible as a preview when you rotate, then you stop it fades out after a second (giving time for the turtle to start redrawing from the new angle).

What do you think?

_________________
My OS is Perception.


Top
 Profile  
 
 Post subject: Re: Tacky Turtle - randomly generated turing drawing machine
PostPosted: Fri Sep 05, 2014 2:34 pm 
Offline
Member
Member

Joined: Sat Mar 01, 2014 2:59 pm
Posts: 1146
That would work until you decide to add the "random number generator" function, although in that case you could store the seed so as to generate the same sequence of random numbers when redrawing and only change the seed when asked to re-generate the random numbers. Storing a seed wouldn't use much memory and there would be no increase in memory usage as more random numbers are generated as would have been the case with what was origianlly going to be my suggestion to store a list of the random numbers generated so that they can be repeated (I really should have known better than to even think of suggesting that LOL).

EDIT: I was actually meaning to post here anyway: this does look quite cool although I haven't tried it though... One more question/suggestion: does it generate random text or does it only use valid symbols which actually do something? If the former then it could get frustrating when a child decides to try changing something and can't understand why the pattern doesn't change!

_________________
When you start writing an OS you do the minimum possible to get the x86 processor in a usable state, then you try to get as far away from it as possible.

Syntax checkup:
Wrong: OS's, IRQ's, zero'ing
Right: OSes, IRQs, zeroing


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 23 posts ]  Go to page 1, 2  Next

All times are UTC - 6 hours


Who is online

Users browsing this forum: No registered users and 103 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group