• Advertisement
  • entries
  • comments
  • views

Neat assignments

Sign in to follow this  


My Java prof handed us an assignment.

Pretty much, you have to code a parser and implement opcodes for a Corewars-style robot battle simulator.

Here are two screenshots, since I'm sure everyone would like to know (even though I didn't build the front-end or graphics).

Here is the source from the last robot:
; robot1.rob
start: mov #1, turn
mov #1, pen
mov #255, penColourRed
mov #300, penColourGreen
mov #100, penColourBlue
mov #5, penWidth
mov #90, thrust
loop: mov #1, turn
mov #100, thrust
bra loop
Sign in to follow this  


Recommended Comments

Yeah, you can have two types of robots -- combat (they hit each other with hammers) or drawing (they doodle with a pen).

Interestingly, this is not actually mutually exclusive; the client allows robots to both draw pretty pictures and kick ass.

Share this comment

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Advertisement