function testPrintEachCardOneAfterAnother()
	for i=1,118 do --prints each card
		screen:clear()
		screen:print(30, 20, "card number "..i.." :", white)
		screen:print(30, 35, "value: "..mainDeck[i].value, white)
		screen:print(30, 50, "color: "..mainDeck[i].color, white)
		screen:print(30, 65, "power: "..mainDeck[i].power, white)
		screen:print(30, 80, "x: "..mainDeck[i].position.x, white)
		screen:print(30, 95, "y: "..mainDeck[i].position.y, white)
		
		drawCard(mainDeck[i])
		
		screen.flip()
		screen.waitVblankStart(40)	
	end

	screen.waitVblankStart(60)	
end

function testExposeMainDeck()
	local num=1
	local card=nil
	for i=1,4 do
		for j=1,30 do
			if num<=118 then
				card=mainDeck[num]
				x=5+(j-1)*14
				y=5+(i-1)*66
				card.position.x=x
				card.position.y=y
				card.visible=true
				card.orientation="verticalmain"
				card.greyed=false
				drawCard(card)
				num=num+1
			end
		end
	end 
	card=nil
	num=nil
end

function testExposeMainDeckEachWay()
	if mainDeck[1].orientation=="horizontal" and mainDeck[1].visible==true and mainDeck[1].greyed==true then
		for i=1,118 do
			mainDeck[i].orientation="verticalsub"
			mainDeck[i].visible=false
		end
	elseif mainDeck[1].orientation=="verticalsub" and mainDeck[1].visible==false then
		for i=1,118 do
			mainDeck[i].visible=true
			mainDeck[i].greyed=false
		end
	elseif mainDeck[1].orientation=="verticalsub" and mainDeck[1].visible==true and mainDeck[1].greyed==false then
		for i=1,118 do
			mainDeck[i].greyed=true
		end
	elseif mainDeck[1].orientation=="verticalsub" and mainDeck[1].visible==true and mainDeck[1].greyed==true then
		for i=1,118 do
			mainDeck[i].orientation="verticalmain"
			mainDeck[i].visible=false
		end
	elseif mainDeck[1].orientation=="verticalmain" then
		for i=1,118 do
			mainDeck[i].orientation="horizontal"
			mainDeck[i].visible=false
			mainDeck[i].greyed=false
		end
	elseif mainDeck[1].orientation=="horizontal" and mainDeck[1].visible==false and mainDeck[1].greyed==false then
		for i=1,118 do
			mainDeck[i].visible=true
		end
	elseif mainDeck[1].orientation=="horizontal" and mainDeck[1].visible==true and mainDeck[1].greyed==false then
		for i=1,118 do
			mainDeck[i].greyed=true
		end
	end
	--screen.waitVblankStart()
end

function testDrawAllCards()
	local num=1
	local card=nil
	if mainDeck[1].orientation=="verticalsub" or mainDeck[1].orientation=="verticalmain" then
		for i=1,4 do
			for j=1,30 do
				if num<=118 then
					card=mainDeck[num]
					x=5+(j-1)*14
					y=5+(i-1)*66
					card.position.x=x
					card.position.y=y
					drawCard(card)
					num=num+1
				end
			end
		end 
	else
		for i=1,17 do
			for j=1,7 do
				if num<=118 then
					card=mainDeck[num]
					x=5+(j-1)*63
					y=5+(i-1)*14
					card.position.x=x
					card.position.y=y
					drawCard(card)
					num=num+1
				end
			end
		end
	end
	card=nil
	num=nil
end




function testWriteProperties(prop)
	local i=0
	for key, value in pairs(prop) do
		screen:print(5, 5+i*14, "'"..key.."' equals '"..value.."'")
		i=i+1
	end
end

function testDrawAvatars()
	for i=1,4 do
		screen:blit(5+(i-1)*80, 70, players[i].avatar,  true)
	end
end

function testDrawPlayerCards()
	local finished=false
	local cardNumber=1
	for i=1,4 do
		finished=false
		cardNumber=1
		while not finished do
			if players[i].hand[cardNumber]==nil then
				finished=true
			else
				players[i].hand[cardNumber].position.x=5+(cardNumber-1)*14
				players[i].hand[cardNumber].position.y=5+(i-1)*64
				drawCard(players[i].hand[cardNumber])
				cardNumber=cardNumber+1
			end
		end
	end
end

function testDebugTableElements(atable)
	enableDebug()
	for key, value in pairs(atable) do
		if type(value)=="string" then
			debug(key.." = "..value)
		else
			debug(key.." is not a string")
		end
	end
	disableDebug()
end

function removeLastElement(atable)
	atable[tableLength(atable)]=nil
	return atable
end







