Lab 3: A non-trivial (non-OOP) java program

Summary:
For this lab you will write a simple game.
It is a turn-based game in which players move a "light-cycle"
with commands f - for forward,
l - for left turn, and r - for right
turn. As the light-cycles move, they leave a trail behind them, and
a light-cycle dies when it crosses its own or its opponent's
trail. What makes the game interesting, is that each player gets
more moves at each turn. (Multiple moves in the sample game must
be space separated.)
You can play the
game by giving the following command at the command-line:

~/wcbrown/bin/tryLab3

Note: Please resize your terminal window to have at least
42 lines.

The Board

The board is a grid of 40x40 cells. You'll want to represent
this as a 2D array of ints or chars
or something. You define such a beast in Java like this

int[][] board = new int[40][40];

or this

char[][] board = new char[40][40];

Of course, you still need to initialize the entries in the 2D
array! How you use this array to represent the board state
is, of course, up to you!

The players

Player 1's light-cylce starts at row 20, column 0.
Player 2's light-cylce starts at row 20, column 39.
A player's light-cycle has, at any given point in time,
a location and a direction, and the moves (f,l,r) are always
with respect to that current direction. Dr. Crabbe suggests
you make a separate class for a "player", that stores the
location and direction.

Winning/Losing

A player loses if he moves to a square occupied by the other
player, or a square that's part of either his or the other
player's trails, or if he moves off of the board.

Misc. Hints

Since multiple moves are required to be space-separated,
you can read in the next character in the move sequence with

in.next().charAt(0);

Hopefully you see why this works!
Also, so you don't get caught up with this, Dr. Crabbe reads
in the y/n character after asking whether you're ready to
move, but goes on and asks for the move no matter what you
say! You can do the same.