%Declaration Statments
var square_id : string
var attacked : boolean := false
% Player Squares
var a1, a2, a3, a4, a5, a6, a7, a8, a9, a10 : int := 0 % 0 is empty, 1 is hit, 2 is miss
var b1, b2, b3, b4, b5, b6, b7, b8, b9, b10 : int := 0
var c1, c2, c3, c4, c5, c6, c7, c8, c9, c10 : int := 0
var d1, d2, d3, d4, d5, d6, d7, d8, d9, d10 : int := 0
var e1, e2, e3, e4, e5, e6, e7, e8, e9, e10 : int := 0
var f1, f2, f3, f4, f5, f6, f7, f8, f9, f10 : int := 0
var g1, g2, g3, g4, g5, g6, g7, g8, g9, g10 : int := 0
var h1, h2, h3, h4, h5, h6, h7, h8, h9, h10 : int := 0
var i1, i2, i3, i4, i5, i6, i7, i8, i9, i10 : int := 0
var j1, j2, j3, j4, j5, j6, j7, j8, j9, j10 : int := 0
% Opponent Squares
var oa1, oa2, oa3, oa4, oa5, oa6, oa7, oa8, oa9, oa10 : int := 0
var ob1, ob2, ob3, ob4, ob5, ob6, ob7, ob8, ob9, ob10 : int := 0
var oc1, oc2, oc3, oc4, oc5, oc6, oc7, oc8, oc9, oc10 : int := 0
var od1, od2, od3, od4, od5, od6, od7, od8, od9, od10 : int := 0
var oe1, oe2, oe3, oe4, oe5, oe6, oe7, oe8, oe9, oe10 : int := 0
var of1, of2, of3, of4, of5, of6, of7, of8, of9, of10 : int := 0
var og1, og2, og3, og4, og5, og6, og7, og8, og9, og10 : int := 0
var oh1, oh2, oh3, oh4, oh5, oh6, oh7, oh8, oh9, oh10 : int := 0
var oi1, oi2, oi3, oi4, oi5, oi6, oi7, oi8, oi9, oi10 : int := 0
var oj1, oj2, oj3, oj4, oj5, oj6, oj7, oj8, oj9, oj10 : int := 0
% X Y to Square ID - Inputs XY, Outputs the Square ID for processing
procedure xySquareID (xin : int, yin : int)
if xin >= 2 and xin < 27 then
square_id := "a"
elsif xin >= 27 and xin < 52 then
square_id := "b"
elsif xin >= 52 and xin < 77 then
square_id := "c"
elsif xin >= 77 and xin < 102 then
square_id := "d"
elsif xin >= 102 and xin < 127 then
square_id := "e"
elsif xin >= 127 and xin < 152 then
square_id := "f"
elsif xin >= 152 and xin < 177 then
square_id := "g"
elsif xin >= 177 and xin < 202 then
square_id := "h"
elsif xin >= 202 and xin < 227 then
square_id := "i"
elsif xin >= 227 and xin < 252 then
square_id := "j"
end if
if yin >= 2 and yin < 27 then
square_id := square_id + "10"
elsif yin >= 27 and yin < 52 then
square_id := square_id + "9"
elsif yin >= 52 and yin < 77 then
square_id := square_id + "8"
elsif yin >= 77 and yin < 102 then
square_id := square_id + "7"
elsif yin >= 102 and yin < 127 then
square_id := square_id + "6"
elsif yin >= 127 and yin < 152 then
square_id := square_id + "5"
elsif yin >= 152 and yin < 177 then
square_id := square_id + "4"
elsif yin >= 177 and yin < 202 then
square_id := square_id + "3"
elsif yin >= 202 and yin < 227 then
square_id := square_id + "2"
elsif yin >= 227 and yin < 252 then
square_id := square_id + "1"
end if
end xySquareID
% Check if Already Attacked
procedure checkAttacked (squ_id:string)
end checkAttacked |