home .. forth .. colorforth mail list archive ..

Re: [colorforth] ANN c4thchess and c4thche2 (inclds personnal note To: HOakford)


Hi Chris, and thank you for your continued interest :)

Yes, Sir!  The point for the chesses was to shorten the editor
learning curve so that the environment learning curve could begin. I
should have that tutor done in a week or so.

Most likely, you will need to type the 2 chesses coded into your
editor in different blocks than what I used, as the blocks that I used
will probubly be used by other code.  I suggest putting it last as the
recording copyadvance block could overwrite existing blocks -- please
note the note there!.

Please be sure that you notice block 30 where I redefined ( or I
should say inserted )  a definition in   ' 5* '   to add   ' pr ' 
used in the chess.

<r>5* <grdec> 5
<r>pr <g>for 2emit next ;

note: that pr ( print) takes a count

Please also note that the 18 block has a few defs that are specific to
the chesses. You see the '<r>2ch'  def there that 'turns on" both
chesses.

If you were to type in the code like it appears on blocks 80,82,84
(c4thchess) ,86(c4thches2),88(copyadvance) - keeping in mind to code
the "load" definitions to the blocks _you_ put them on, then code
block 18 with the chess load instructions and run '2ch' -- you will
see the Icons-graphical display of the board with pieces in position
of a current game in progress.

The next thing your gonna wanna do is ...
type 'cb'  this brings you to the current recording board, for you to
update the next move.  (provided you coded the all the demo game
blocks ( which I really don't recommend unless you need the practice) 
and set the recording vars properly) ( provided you read the note that
is included with the code block 'cb'  is on and it's swap block )
( be sure when codeing that block to set the record vars appropriatly) 

type 'chs' and your back to the  main board.

to move 

Think of the sentance you need to use to tell the computer to move the
piece. You would say something like

white kings bishop move 5 squares up-left. 

so to move you type

wkb m 5 ul 
( on the editor command line -- this plays in the editor) 

wkb 
puts the address of the white king bishop variable on the stack.
m 
sets that variable as the move pointer
ul 
is a move function that takes a count. therefore even moveing 1 square
up you are (currently but not for long) required to put the 1 on the
stack. otherwise the game will crash-- in case of crash just you will
have to reset your computer ( sorry)  and '2ch' and your back --
pieces always remember where they are.

m will eventually disapear. I dont like the fact that sometimes I
forget to type it and move the last mover by mistake.
calling the piece var to the stack will automatically call m in the future. 

when you set a piece as the mover it is always the mover till you set
another one -- this is convenient when moveing Knights as you need two
moves to move them.

to take pieces off the board just move them off to the side.

I've add bounds to the move functions currently so that pieces don't
go off the screen ( they don't go off the screen really - they just
get stuck somewhere in that version and you can correct this by going
to its variable -- cuting it off the block and redefining it. When you
restart the game the offending piece will be in the 0,0 position ( top
left ) and you can move it back to where you want.

after making a move, 'cb' to the current block of the c4thches2
( remember, If you didn't code my 'demo game in progress' them calling
'cb' at this point will bring you to the block that I have set in the
cbl var on the copyadvance page unless you reset it properly ).

Please note that calling 'nb' on that copyadvance page could be very
dangerous .

There are copies of variables on the block 79 for all the pieces in
there first postitions.  copy them to a blank block and and replace
the ones on the pieces blocks with the copies using the cursor to
reset the board for a new game. my new version put all these vars on
the same block and copying/replacing is much easier now . one function
.

The c4thches2 can be used alone without the copyadvance feature as a
game by itself.

The above versions are the most simplest chesses I could think of.

After reading Starting Forth, It dawned on me that I could turn any
forth interpreter into a chess interpreter. I thought I would do a
general version in Gforth to use in any forth interpreter and to give
me enough education to 'crack' colorForth --- little did I know that I
would actually finish the colorForth versions first.

My current version of c4thchess is moving on to included all the
changes I mentioned above plus jumptables instead of variables.  This
is necessary for the tutorial.

Thanks again -- Ray
Rastm2 At Users dot sourceforge dot net 
Raystm2 At Gmail dot com
irc.freenode /join #c4th-ot

On Mon, 18 Oct 2004 18:52:02 -0700, Chris Walton
<chris.r.walton@xxxxxxxxx> wrote:
> Awesome. Do you have some sort of "tutorial" with it of some sorts? Or
> can you explain here how it works? I see from the screen shot that you
> use it _in the editor_, but I can't quite seem to be able to figure
> out how it works ;)
> 
> 
> 
> 
> On Mon, 18 Oct 2004 20:47:02 -0500, Ray St. Marie <ray.stmarie@xxxxxxxxx> wrote:
> > Hi Chris,
> >
> > Yeah , just have to type it in . there is nothing non-portable about
> > that code :)
> >
> > Ray
> >
> > On Mon, 18 Oct 2004 15:42:40 -0700, Chris Walton
> >
> >
> > <chris.r.walton@xxxxxxxxx> wrote:
> > > Awesome stuff! I'll have to try it. Any idea if it'll work on XColorForth?
> > >
> > > ---------------------------------------------------------------------
> > > To unsubscribe, e-mail: colorforth-unsubscribe@xxxxxxxxxxxxxxxxxx
> > > For additional commands, e-mail: colorforth-help@xxxxxxxxxxxxxxxxxx
> > > Main web page - http://www.colorforth.com
> > >
> > >
> > 
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: colorforth-unsubscribe@xxxxxxxxxxxxxxxxxx
> > For additional commands, e-mail: colorforth-help@xxxxxxxxxxxxxxxxxx
> > Main web page - http://www.colorforth.com
> >
> >
> 
> 
> --
> I F34R N0N3 F0R F0RTH SH4LL GUID3 M3
> 
> ---------------------------------------------------------------------
> 
> 
> To unsubscribe, e-mail: colorforth-unsubscribe@xxxxxxxxxxxxxxxxxx
> For additional commands, e-mail: colorforth-help@xxxxxxxxxxxxxxxxxx
> Main web page - http://www.colorforth.com
> 
>

---------------------------------------------------------------------
To unsubscribe, e-mail: colorforth-unsubscribe@xxxxxxxxxxxxxxxxxx
For additional commands, e-mail: colorforth-help@xxxxxxxxxxxxxxxxxx
Main web page - http://www.colorforth.com