<?xml version="1.0" encoding="UTF-8" ?>
<rss version="2.0" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:wikidot="http://www.wikidot.com/rss-namespace">

	<channel>
		<title>Tic Tac Toe</title>
		<link>http://gamedesign.wikidot.com/forum/t-9750/tic-tac-toe</link>
		<description>Posts in the discussion thread &quot;Tic Tac Toe&quot; - first Free Basic program</description>
				<copyright></copyright>
		<lastBuildDate>Wed, 09 Sep 2026 18:34:40 +0000</lastBuildDate>
		
					<item>
				<guid>http://gamedesign.wikidot.com/forum/t-9750#post-24083</guid>
				<title>Re: Tic Tac Toe</title>
				<link>http://gamedesign.wikidot.com/forum/t-9750/tic-tac-toe#post-24083</link>
				<description></description>
				<pubDate>Fri, 18 May 2007 02:06:57 +0000</pubDate>
				<wikidot:authorName>hartnell</wikidot:authorName>				<wikidot:authorUserId>10978</wikidot:authorUserId>				<content:encoded>
					<![CDATA[
						 <p>I think in her intro she said she was a programmer by trade, but didn't program game well. (yet.) Kind of a mini-RDC from years ago.</p> <p>Great job, BTW.</p> <p>&#8212;hartnell</p> 
				 	]]>
				</content:encoded>							</item>
					<item>
				<guid>http://gamedesign.wikidot.com/forum/t-9750#post-23939</guid>
				<title>Re: Tic Tac Toe</title>
				<link>http://gamedesign.wikidot.com/forum/t-9750/tic-tac-toe#post-23939</link>
				<description></description>
				<pubDate>Thu, 17 May 2007 09:57:52 +0000</pubDate>
				<wikidot:authorName>bmatthew1</wikidot:authorName>				<wikidot:authorUserId>11779</wikidot:authorUserId>				<content:encoded>
					<![CDATA[
						 <p>Wow, that's Excellent for your first Basic Programme. :)</p> <p>I thought you said you weren't very good at Basic, lol. :)</p> <p>Now all you need is a short routine to Exit the Programme Correctly and it'll be finished.</p> 
				 	]]>
				</content:encoded>							</item>
					<item>
				<guid>http://gamedesign.wikidot.com/forum/t-9750#post-23898</guid>
				<title>Tic Tac Toe</title>
				<link>http://gamedesign.wikidot.com/forum/t-9750/tic-tac-toe#post-23898</link>
				<description></description>
				<pubDate>Thu, 17 May 2007 06:34:55 +0000</pubDate>
				<wikidot:authorName>ZoeG</wikidot:authorName>				<wikidot:authorUserId>18772</wikidot:authorUserId>				<content:encoded>
					<![CDATA[
						 <p>This isn't done yet, but it has some functionality. I had a bit of trouble with the language, but I worked around it so it may look pretty lame in spots.</p> <div class="code"> <pre><code>screen 18, 32 width 80,60 color 0, rgb(255,255,255) cls const vk_up = 72 const vk_right = 77 const vk_down = 80 const vk_left = 75 dim shared theRow = 1 dim shared theCol = 1 enum theDirection dUP = 1 dDOWN dRIGHT dLEFT END enum dim shared theGrid(3,3) as Integer for i = 1 TO 3 for j = 1 to 3 theGrid(i, j) = ASC(&quot; &quot;) NEXT j NEXT i type dieTP value as integer kept as integer end type dim choice as string sub showTitle print print &quot; TIC-TAC-TOE&quot; print print &quot; Version 1.0&quot; print print &quot;Use arrow keys to navigate, press X to move&quot; print &quot; Q to exit&quot; print end sub sub drawGrid(clearIt as integer ) 'Draw board const offset = 10 const length = 4 const halfLength = 2 'Draw the Grid for i = offset to (offset+(length*3)) locate (offset+length), i print &quot;-&quot; locate i, (offset+length) print &quot;|&quot; locate (offset+length*2), i print &quot;-&quot; locate i, (offset+length*2) print &quot;|&quot; next i locate (offset+length),(offset+length) print &quot;+&quot; locate (offset+length),(offset+length*2) print &quot;+&quot; locate (offset+length*2),(offset+length) print &quot;+&quot; locate (offset+length*2),(offset+length*2) print &quot;+&quot; 'Draw Selection for i = 1 to 3 for j = 1 to 3 locate (offset + halfLength + (i-1) * (length)),(offset + halfLength + (j-1) * (length)) if theRow = i and theCol = j then color , rgb(200,200,200) if CHR(theGrid(i,j)) = &quot; &quot; then print &quot;?&quot; else print CHR(theGrid(i,j)) end if color , rgb(255,255,255) else print CHR(theGrid(i,j)) end if next j next i locate 35, 1 if clearIt then PRINT &quot; &quot; end if end sub function playerMove() if CHR(theGrid(theRow,theCol)) = &quot; &quot; then theGrid(theRow,theCol) = ASC(&quot;X&quot;) return 1 else locate 35, 1 PRINT &quot;Invalid Move&quot; return 0 end if 'drawGrid( 0 ) end function sub moveCursor( direction as integer ) select case direction case dUP 'print &quot;UP direction&quot; if theRow &gt; 1 then theRow = theRow - 1 end if case dDOWN 'print &quot;DOWN direction&quot; if theRow &lt; 3 then theRow = theRow + 1 end if case dLEFT 'print &quot;LEFT direction&quot; if theCol &gt; 1 then theCol = theCol - 1 end if case dRIGHT 'print &quot;RIGHT direction&quot; if theCol &lt; 3 then theCol = theCol + 1 end if end select end sub function moveToWin return false end function function moveToBlock return false end function sub makeRandomMove 'print &quot;not done yet&quot; for i = 1 to 3 for j = 1 to 3 if CHR(theGrid(i, j)) = &quot; &quot; then theGrid(i,j) = ASC(&quot;O&quot;) return end if next j next i end sub sub computerMove if NOT moveToWin then if NOT moveToBlock then makeRandomMove end if end if end sub function isGameOver for i = 1 to 3 for j = 1 to 3 if CHR(theGrid(i,j)) = &quot; &quot; then return 0 end if next j next i return 1 end function rem Start Execution Here showTitle print cls showTitle drawGrid(1) do do choice = inkey loop until choice &lt;&gt; &quot;&quot; if choice = &quot;q&quot; then end 'Player wants to exit if choice = &quot;Q&quot; then end if choice = &quot;X&quot; or choice = &quot;x&quot; then if playerMove = 0 then drawGrid(0) else locate 35, 1 'print &quot;COmputer move&quot; computerMove drawGrid(0) end if elseif MULTIKEY(vk_up) then moveCursor( dUP ) drawGrid(1) elseif MULTIKEY(vk_down) then moveCursor( dDOWN ) drawGrid(1) elseif MULTIKEY(vk_right) then moveCursor( dRIGHT ) drawGrid(1) elseif MULTIKEY(vk_left) then moveCursor( dLEFT ) drawGrid(1) endif 'Need to detect if game is done if isGameOver = 1 then locate 36,1 print &quot;GAME OVER -- sorry re-play is not implemented&quot; end if loop</code></pre></div> 
				 	]]>
				</content:encoded>							</item>
				</channel>
</rss>