flat assembler
Message board for the users of flat assembler.

Index > Programming Language Design > Challenger Interpreter

Goto page Previous  1, 2, 3
Author
Thread Post new topic Reply to topic
Tomasz Grysztar



Joined: 16 Jun 2003
Posts: 8351
Location: Kraków, Poland
Tomasz Grysztar 09 Sep 2009, 15:30
Some funny program I made as an experiment - it makes the data pointer travel inside the box and turn right if it meets any obstacle. Of course you can add obstacles in real-time with the Poke operation.
Code:
1"0-\7:):v):!?<
         >" - |
         ^   .<

OOOOOOOOOOOOOOOOOOOOOOOOOOOOOO
O                            O
O                            O
O                            O
O                            O
O                            O
O                            O
O                            O
O                            O
O                            O
O                            O
O                            O
O                            O
OOOOOOOOOOOOOOOOOOOOOOOOOOOOOO    
Maybe this could be made into some kind of game, but I definitely do not have so much spare time.


Last edited by Tomasz Grysztar on 09 Sep 2009, 15:33; edited 1 time in total
Post 09 Sep 2009, 15:30
View user's profile Send private message Visit poster's website Reply with quote
revolution
When all else fails, read the source


Joined: 24 Aug 2004
Posts: 20300
Location: In your JS exploiting you and your system
revolution 09 Sep 2009, 15:32
Nokia phones have the silly snake game. So perhaps you can make it like that.
Post 09 Sep 2009, 15:32
View user's profile Send private message Visit poster's website Reply with quote
rugxulo



Joined: 09 Aug 2005
Posts: 2341
Location: Usono (aka, USA)
rugxulo 09 Sep 2009, 18:59
No way, someone should make a full-featured Blackjack: split, doubledown, surrender, insurance, etc. Smile
Post 09 Sep 2009, 18:59
View user's profile Send private message Visit poster's website Reply with quote
Tomasz Grysztar



Joined: 16 Jun 2003
Posts: 8351
Location: Kraków, Poland
Tomasz Grysztar 19 Sep 2009, 12:07
As I have some ideas for Challenger 2.0, but it is likely I will not have any time to work on it soon, I'm going to write them down here, so they can wait for better times. Wink

What I'd like to have is to get a kind of Core Wars, so Challenger 2.0 would allow unlimited multithreading - there would be a new instruction 'f', splitting any thread into two, the second one traveling perpendicularly. Each thread would have its own accumulator, DP and SP, but they all would share the same plane. So that they would be able to compete, communicate, and perhaps even interact in other interesting ways. Any thread reaching an exception state would simply vanish.

As for the interpreter implementation, it would be optimized for more large-scale operation. The plane would be divided into large blocks, each one connected to four neighbours (just like the segments in Challenger 1.0), or with zero pointers when at the edge of allocated rectangular space. When plane needs to be expanded, the new row of blocks would be allocated and linked to the blocks on the current edge (again, like with segments in Challenger 1.0). Interpreter would start with just one block allocated.
Internally, each block would consist of pointers to segments - each segment being a rectangular part of plane, like 100x100 cells. When some part of plane was not initialized yet, the pointer would still be zero, and the segment would get allocated only when needed. One block would be 100x100 segments, and since pointer to segment and cell would have the same size, the block data and segment data would be of the same size as well (well, it's not really important, but nice anyway).

Large scale would be necessary to try to simulate some evolutionary behaviors. Perhaps some randomization features would be needed to add, too (though I'm not really sure about this one, see the article about Tierran Mutants linked earlier in this thread).
Post 19 Sep 2009, 12:07
View user's profile Send private message Visit poster's website Reply with quote
SFeLi



Joined: 03 Nov 2004
Posts: 138
SFeLi 15 Dec 2010, 09:52
Tomasz Grysztar, there is a bug in your interpreter: pop edi after .program_initialized is excess as it actually pops an lpvAddress argument for VirtualFree, and thus changes ControllerDialogProc return address. It works in XP by accident, but in 9x it reboots/hangs an OS.
Post 15 Dec 2010, 09:52
View user's profile Send private message Reply with quote
Tomasz Grysztar



Joined: 16 Jun 2003
Posts: 8351
Location: Kraków, Poland
Tomasz Grysztar 15 Dec 2010, 13:06
Thanks, I updated it.
Post 15 Dec 2010, 13:06
View user's profile Send private message Visit poster's website Reply with quote
edfed



Joined: 20 Feb 2006
Posts: 4330
Location: Now
edfed 15 Dec 2010, 22:06
SFeLi wrote:
Tomasz Grysztar, there is a bug in your interpreter: pop edi after .program_initialized is excess as it actually pops an lpvAddress argument for VirtualFree, and thus changes ControllerDialogProc return address. It works in XP by accident, but in 9x it reboots/hangs an OS.


ok, it was the cause of the reboot i had when i tryed it... then, it's time to retest it.
Post 15 Dec 2010, 22:06
View user's profile Send private message Visit poster's website Reply with quote
Display posts from previous:
Post new topic Reply to topic

Jump to:  
Goto page Previous  1, 2, 3

< Last Thread | Next Thread >
Forum Rules:
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 vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Copyright © 1999-2024, Tomasz Grysztar. Also on GitHub, YouTube.

Website powered by rwasa.