#
# board.jako
#
# An example that prints a Chess board using simple looping constructs.
#
# Copyright (C) 2001-2003 Gregor N. Purdy. All rights reserved.
# This program is free software. It is subject to the same
# license as the Parrot interpreter.
#
# $Id: board.jako,v 1.3 2003/07/03 15:32:25 gregor Exp $
#

use sys;

var int rank, file;
var int temp;

rank = 7;

sys::print("  +---+---+---+---+---+---+---+---+\n");

while(rank >= 0) {
  temp = rank + 1;
  file = 0;

  sys::print("$temp |");

  while(file < 8) {
    temp = rank + file;
    temp %= 2;
 
    if (temp == 1) {
      sys::print("   |");
    } else {
      sys::print(" * |");
    }

    file++;
  }

  sys::print("\n");
  sys::print("  +---+---+---+---+---+---+---+---+\n");
  rank--;
}

sys::print("    A   B   C   D   E   F   G   H  \n");

