Jump to content

Photo

Demons

A cyclic cellular automaton

11 replies to this topic

#1 lucien2 OFFLINE  

lucien2

    Chopper Commander

  • 248 posts
  • Location:Switzerland

Posted Thu Mar 22, 2012 6:37 PM

Here is a small GCC test: A two dimensional cyclical cellular automaton.
http://en.wikipedia....more_dimensions



Spoiler


Attached File  DEMONS.zip   15.17KB   12 downloads

#2 Vorticon OFFLINE  

Vorticon

    Stargunner

  • 1,246 posts
  • Location:Eagan, MN, USA

Posted Thu Mar 22, 2012 7:16 PM

I love these mathematical demos :) Now try it in bitmap mode for better resolution!

#3 lucien2 OFFLINE  

lucien2

    Chopper Commander

  • Topic Starter
  • 248 posts
  • Location:Switzerland

Posted Fri Mar 23, 2012 12:37 AM

I already did it in assembly 10 years ago, without any debugger. That was my first assembly program on TI. It's really too slow, it takes 50 seconds per cycle.

It can be optimized, the registers are in the RAM extension.
There are 4 times the number of pixels than the multicolor mode and it takes 3 seconds per cycle with GCC (should be 3*4=12 seconds).

Spoiler


#4 lucien2 OFFLINE  

lucien2

    Chopper Commander

  • Topic Starter
  • 248 posts
  • Location:Switzerland

Posted Sat Mar 24, 2012 7:08 AM

How about an object-oriented dialog library?

Spoiler


http://www.youtube.com/watch?v=lO_Hfr1ZFBQ

Attached Files



#5 Vorticon OFFLINE  

Vorticon

    Stargunner

  • 1,246 posts
  • Location:Eagan, MN, USA

Posted Sat Mar 24, 2012 3:39 PM

No idea what that means :)

#6 lucien2 OFFLINE  

lucien2

    Chopper Commander

  • Topic Starter
  • 248 posts
  • Location:Switzerland

Posted Sun Mar 25, 2012 12:37 AM

That means you have 2 different objects that share some properties and some functions. I just discovered yesterday that you can do object-oriented programming in plain old C.
http://en.wikipedia....ted_programming

Two different objects:

Button b1;
b1.field.text="[   OK   ]";
b1.field.key='O';
b1.field.key_index=4;
b1.field.position.x=2;
b1.field.position.y=21;
b1.field.action=ok_action;
create_button(&b1);

Edit e;
e.field.text="Number of colors: ";
e.field.key='N';
e.field.key_index=0;
e.field.position.x=2;
e.field.position.y=5;
e.value=colors_number;
e.min=2;
e.max=15;
e.length=3;
create_edit(&e);

You can send them a function as if they were the same kind. That's named with the barbarian word "polymorphism". http://en.wikipedia....mputer_science)


Field* fields[3]= {&b1.field,&b2.field,&e.field};
...

for(i=0;i<fields_number;i++)fields[i]->show(fields[i]);
...
for(i=0;i<fields_number;i++) {
	Field* f=fields[i];
	if(key==f->key)f->action(f);
}


#7 Willsy ONLINE  

Willsy

    Stargunner

  • 1,983 posts
  • Location:Uzbekistan (no, really!)

Posted Sun Mar 25, 2012 1:17 AM

He he! Nice! You can do the same thing in Forth, but there's no type checking.... Nothing to stop you calling a method from one class on another class!

#8 Vorticon OFFLINE  

Vorticon

    Stargunner

  • 1,246 posts
  • Location:Eagan, MN, USA

Posted Sun Mar 25, 2012 6:39 AM

Ah yes, object oriented programming. Still on my list to learn (I had started working on it with Turbo Pascal 5), but then got diverted to greener pastures. Maybe some day he he :)

#9 lucien2 OFFLINE  

lucien2

    Chopper Commander

  • Topic Starter
  • 248 posts
  • Location:Switzerland

Posted Sun Apr 1, 2012 2:06 PM

Now try it in bitmap mode for better resolution!


Here it is, boss. I hope you will use it everyday. :-D

There is only a cartridge binary, because the high memory is full with my 2 bitmap buffers.

I could use nibbles for the colors, that would free 12k but it would be much slower.
I could also use VDP RAM, even more slower.

http://www.youtube.com/watch?v=MkJD0eENNDE

Attached File  DEMONS4.zip   15.06KB   14 downloads

Spoiler


#10 Vorticon OFFLINE  

Vorticon

    Stargunner

  • 1,246 posts
  • Location:Eagan, MN, USA

Posted Sun Apr 1, 2012 7:44 PM

Very cool :) I find it fascinating how mathematical concepts can evolve into interesting graphical patterns.

#11 rocky007 OFFLINE  

rocky007

    Moonsweeper

  • 395 posts
  • Location:Belgium

Posted Mon Apr 2, 2012 12:39 AM

like it very much ;)... it's so peaceful to watch

#12 lucien2 OFFLINE  

lucien2

    Chopper Commander

  • Topic Starter
  • 248 posts
  • Location:Switzerland

Posted Mon Apr 2, 2012 4:39 AM

I know. I was 10 years old when my father did it on the mac plus. I remember I spent hours fascinated by the pixels organizing themselves.




0 user(s) are browsing this forum

0 members, 0 guests, 0 anonymous users