04-29-2005, 10:55 AM
First off, I want to say hello everyone. I just found out about freebasic a couple days ago and I'm very excited about it. I used to program in QB all the time a few years ago. Well I havn't touched it for a couple years and now I want to get into it again. I've decided to write a simple tic tac toe game to get back into the groove but I'm having some problems. First off, I have my board array set up like so ..
Here is a trimmed down version of what's causing my problem.
If I try to compile that I get an error 9 : Expected Expression
if board(0,2) = 1 and board(1,1) = 1 and board(2,0) = 1 or
If I replace that or with a then and comment out the other board checking lines it compiles just fine. That leads me to beleive that I'm using 'or' wrong. All I have for reference are some old QB tutorials I've found and from what I can tell it should be correct .. can anyone help me out?
Thanks,
Gunder
Code:
dim shared board(0 to 2,0 to 2) as integer
Here is a trimmed down version of what's causing my problem.
Code:
function checkwin
if board(0,2) = 1 and board(1,1) = 1 and board(2,0) = 1 or
board(0,0) = 1 and board(1,1) = 1 and board(2,2) = 1 then
checkwin = 1
else
checkwin = 0
end if
end function
If I try to compile that I get an error 9 : Expected Expression
if board(0,2) = 1 and board(1,1) = 1 and board(2,0) = 1 or
If I replace that or with a then and comment out the other board checking lines it compiles just fine. That leads me to beleive that I'm using 'or' wrong. All I have for reference are some old QB tutorials I've found and from what I can tell it should be correct .. can anyone help me out?
Thanks,
Gunder
gunder
"I have a perfect body, but it's in the trunk and starting to smell."
"I have a perfect body, but it's in the trunk and starting to smell."