Showing posts with label programming. Show all posts
Showing posts with label programming. Show all posts

Friday, 13 March 2009

nano papers: ghoulish and Apis Mellifera

Here are a couple of nano paper/clear I've been playing with recently using a mov.i #1,<1 anti-imp clear.

;redcode-nano
;name ghoulish
;author S.Fernandes
;strategy paper/clear
;assert CORESIZE == 80

pstep equ -39
cpos equ -18
dpos equ 27

paper spl #-21 , <-32
mov }paper-1 , }pboot
mov.i #1 , <1
pboot spl <pstep , cpos
djn.f paper+1 , <dpos
end


;redcode-nano
;name Apis Mellifera
;author S.Fernandes
;strategy paper/clear
;assert CORESIZE == 80

pstep equ -22
cpos equ -18
dpos equ -8

paper spl #0 , <33
mov }paper , }pboot
pboot spl <pstep , <-16
mov.i #1 , <1
djn paper+1 , #dpos
end

Sunday, 1 March 2009

Redcode Forth

redcode forth interpreterRedcode Forth is an interpreter for a 36 word subset of the Forth programming language. I don't know much about Forth, but fortunately the interpreter is supplied with a summary of the instruction set and a step-by-step example.

The interpreter uses a new Redcode instruction to display text, sts. I wonder if John is also planning to support ARES which has a different system for i/o?

Wednesday, 19 November 2008

nanoWarrior #03

nanoWarrior - incredibly small corewarThe latest issue of nanoWarrior has finally been completed, containing articles by John Metcalf, German Labarga and me. Check it out for yourself here:

Wednesday, 12 November 2008

Neo's Mini Challenge - Roy's Idea

Roy suggested a tricky extension to Neo's Mini Challenge in rec.games.corewar:
Lets try to find a solution for this gate:
djn.f #0,>-5
(I haven't got one yet)
It appears a one instruction solution isn't possible. However, 5 players found a solution in two instructions.  Congratulations to Ilmari, John, Rashnok, Roy and me! Also, well done to German and Lukasz who also discovered solutions, albeit slightly longer.

I discovered a five line imp:
imp mov.i #4,   *1
mov.i #4, *1
mov.i #4, *1
mov.i #4, *1
mov.i #4, *1
By adding a loop, I managed to reduce the initial size to two instructions:
imp mov.i #4,   *1
djn.a imp, #0
John and Rashnok discovered the same 3 line imp and used a loop to reduce the size. Ilmari discovered a 2 line imp. Roy wrote a program to find 58 solutions by brute force!

Full details are on Neo's page for the Harmless Overrun Mini Challenge.

Wednesday, 22 October 2008

Neo's Mini Challenge - The Results

Neo's Mini Challenge is over and the results are in. Seven players entered, 6 of who discovered an optimal solution - 1 line, 1 process, 100% ties.

Neo and I entered the following code:
mov }0, }1

Ilmari and John entered this:
mov.i #1, *1

While Roy and Rashnok used a variation on the above:
mov.i #1, }1

Finally, mjp entered code which expands to a 6 line imp:
mov 2, @1
djn -1, #6
mov 0, >6

Roy suggested an interesting alternative which Neo will hopefully adopt as the next challenge.