 		for piece in vis
 			console.log piece.join(' ')
 
+	importFEN: (str) ->
+		x = y = 0
 
+		# first we fill the board
+		while y < 8
+			next = str[0]
+			str = str[1...]
 
+			# if we finished this rank go to the next one
+			if x > 7
+				x = 0
+				y++
+				continue
+
+			# FEN uses numbers to denote # of empty cells
+			unless isNaN next
+				x += next
+				continue
+
+			# set the coordinate to the piece
+			@set(x,y,next)
+
+			# increment our file
+			x++
+
+		# TODO handle rest of the FEN string...
+
+	setup: (type) ->
+		switch type
+			when "classic"
+				@importFEN( "rnbqkbnr/pppppppp/8/8/8/8/PPPPPPPP/RNBQKBNR w KQkq - 0 1" )
 
 
 # some tests

#console.log xyToan 1, 8

myBoard = new Board
myBoard.set("a2", new Knight true)
myBoard.set(1,1, new Knight false)

myBoard.log()

#console.log myBoard.get(1,2)


		return board[x][y]

	# fills an 8x8 board array
	visual: ->
		for y in [0..7]
			for x in [0..7]
				@get(x,y).symbol

	# draw the board to the console
