Close

Robot Warfare 1

A project log for nedoPC SDK

Software Development Kit for DIY programmable devices, Retro computers and Supercon badges ;)

shaosSHAOS 05/19/2018 at 18:350 Comments

As I wrote in details of this project, programming language that I use here came from my "hobby" game "Robot Warfare 1" that I released in 1998 as shareware - it was used to program robots - something like this:

   % ================= WSIMPLE.RW1 ==================
   % Example of simple robot 
   % with an eye
   % and a gun.
   % Run:    RW1_DUEL.EXE  WSIMPLE.RW1

   ROBOT "WinSimple Robot"

     COLOR FFD010

     FRONT EYE
     LEFT  GUN

   START:

     ACT FRONT        % Look in front
     if N!=6 : L1     % If there is a robot there then
        RIGHT
        ACT LEFT      % shoot
        LEFT
        GOTO START
     L1:
     if N!=3 : L3     % If there is a box with missles then
        STEP          % go ahead
        GOTO START
     L3:              % If there is neither box nor robot then
                      % it means that there is a barrier in the direction 
     if D==1 : L4     % If the distance from it is greater then 1 then
        STEP          % make a step
        GOTO START
     L4:
     RIGHT            % If the barrier is in the next cell
     GOTO START       % turn to right

   END

In 1999-2000 I upgraded this programming language for "Robot Warfare 1" v2  to make it more C-like (in the same time I released its compiler as open source software under GPL) - now simplest robot looks like this:

robot "NewSimple"
author "SANYA"

color 000030

front eye
left  gun
right gun

+rw1_std.rwi

main()
{
   act front
   if(N==@t_robot) call shoot1
   else
   {
      say "See &N ( &D ) M=&M E=&E !"
      if(N==@t_box||D>1) step
      else
      {
         if(R>500) right
         else left
      }
   }
}

shoot1()
{
  right
  A = @left
  for(aa=0,aa<3,aa++)
  {
     call shoota
  }
  left
}

shoota()
{
  act A
  act A
  act A
  act A
  act A
}

then I created RW1P2 - crosscompiler that compiles robot bytecode to i8080 assembler program using some set of rules and libraries, for example we can have a tile 8x8:

   ########  => #FF
   #      #  => #81
   # #  # #  => #A5
   #      #  => #81
   #      #  => #81
   #  #####  => #9F
   #      #  => #81
   ########  => #FF

with black ink and red paper - it's hexadecimal 40:

   ;8x8-2/16
   ;myspr.spr file
   MYSPR  DB  #FF,#81,#A5,#81,#81,#9F,#81,#FF,#40 ;@ 

 then tile compiler will turn it into binary with header file that could be included into the program:

   // MY.RW1
   robot "MY"
   author "Shaos"
   +myspr.rwi
   main()
   {
      dx = 20
      dy = 10
      for(xx=0,xx<dx,xx++)
      {
        for(yy=0,yy<dy,yy++)
        {
           select xx yy // choose cell for tile output
           set @MYSPR // print tile there
        }
      }
   }

Most significant thing that I did on this programming language was port of "Just Another Tetris" (GPL software by Mattias Wadman) to PetersPlus Sprinter computer in 2002 (and other computers supported by RW1P2):


P.S. Another pretty noisy thing written in this programming language was ASCII PCB and schematics online editor at the end of 2012, but it is totally different story ;)

Discussions