Programming C, C++, Java, PHP, Ruby, Turing, VB
Computer Science Canada 
Programming C, C++, Java, PHP, Ruby, Turing, VB  

Username:   Password: 
 RegisterRegister   
 Using the mouse
Index -> Programming, Turing -> Turing Help
Goto page Previous  1, 2, 3
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
Cervantes




PostPosted: Mon Mar 15, 2004 7:33 pm   Post subject: (No subject)

hmmm.... maybe you SHOULD work on something easier. Thinking
Now that I think more about it, this program is way more complicated than I first imagined.

*a long time later*

Ugh!! Every way I try to do it results in a large amount of if statements (not 1000+, but still Sad )

Here's what I've come up with to move a white pawn

I realize that the functions don't work because the board (row, col) actually equals something like "whtque", not 2 separate parts, "wht" and "que". You can just add in some string manipulation to get it to work Smile
code:

function checkcolour (row, col)
    if board (row, col) = "wht" then
        result white
    elsif board (row, col) = "blk" then
        result black
    end if
end checkpiece
function checkpiece (row, col)
    if board (row, col) = "que" then
        result queen
    elsif board (row, col) = "pawn" then
        result pawn
    %elsif ............
        %result .....
    end if
end checkpiece
    get row1
    get col1
    get row2
    get col2
    if checkcolour (row1, col1) = white then
        if checkpiece (row1, col1) = pawn then
            if board (row2, col2) = " " then
                board (row2, col2) = board (row1, col1)
                board (row1, col1) = " "
            end if
        end if
    end if


That's mearly for a white pawn, without any detection of collisions with other pieces or validation that the move is legal. As you can see, its going to be a rough ride Neutral
Sponsor
Sponsor
Sponsor
sponsor
the_short1




PostPosted: Mon Mar 15, 2004 8:02 pm   Post subject: (No subject)

i silently figured that out to (insert Large Number Here ) of code.. and that is why i didn;t make a chess/// i heard that someone acuallly made one tho//./ maybe thats just a rumur??? is it tru??? and where is it??
Cervantes




PostPosted: Mon Mar 15, 2004 8:13 pm   Post subject: (No subject)

*Imitates Captain Jack Sparrow*
That's interesting...... That's very interesting...
I just did a search for "chess" using the "search" command and it returned a topic made not 3 hours ago. It can be found here.
the_short1




PostPosted: Mon Mar 15, 2004 8:44 pm   Post subject: (No subject)

i am talking about a n older one made a while back... wow... zylum just BAM made a wicked chess game... already works and lookz GREAT
AsianSensation




PostPosted: Mon Mar 15, 2004 8:49 pm   Post subject: (No subject)

bugzpodder made one, I think you could get it from his website, it was a 2 player chess game, I'm pretty sure he didn't have AI with it.
Display posts from previous:   
   Index -> Programming, Turing -> Turing Help
View previous topic Tell A FriendPrintable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic

Page 3 of 3  [ 35 Posts ]
Goto page Previous  1, 2, 3
Jump to:   


Style:  
Search: