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

Username:   Password: 
 RegisterRegister   
 TextFields Help
Index -> Programming, Turing -> Turing Help
Goto page Previous  1, 2
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
[Gandalf]




PostPosted: Wed Jul 13, 2005 9:31 pm   Post subject: (No subject)

This is definately off topic, but...

Quote:
I don;t like your method, by the way besides the graphics and sounds your game is low quality, you have to answer math problems?? what is with that on top of that you get no time, I read the question and hit one number it ended, Plus if you close the window the whole program closes??, Every game like that needs A.I or hotseat (player vs player on same computer.).

This really seems like bashing to me. You are saying that his game isn't good in your view and you ridicule what he does several times. He was forced to follow some guidelines as to what his program is to be like, and he did so well. No time limit, ya, ok, anyone can do 6 * 8 in 5 minutes...

Also, you cannot fix the "bug" that the whole game exits when one window is closed. It is an internal Turing thing, and if you want to fix it, be my guest. Just know that you have to reverse-engineer the client and/or change the C predefs.

Good start by the way. Seems like it's going to be a pretty good game.

*Edit* Ah,... too late Sad.
Sponsor
Sponsor
Sponsor
sponsor
Aziz




PostPosted: Thu Jul 14, 2005 9:39 am   Post subject: (No subject)

Cervantes wrote:
I don't want to re-download your game, Aziz, but I'm curious: have you accounted for integer overflows, or strings that are longer than 255 characters? (Apart from assuming that the user can't type that much in within the time limit. Wink)


Not neccasarily, but I've encountered that problem before when reading from a file :S. But I could fix it, I probably won't want any more than 10 character names anyways, so a simple

[syntax="turing"]if key ~= chr(8) and key ~= chr(10) and length(str) < 10 then
str += key
....etc[/sytnax]

meaning, that code only allows the user to enter a value (beside enter or backspace) if there is less than 10 characters. Now I know, what if they press something like CTRL?
Delos




PostPosted: Thu Jul 14, 2005 8:27 pm   Post subject: (No subject)

Aziz wrote:
what if they press something like CTRL?


Turing:

var ch : array char of boolean

loop
    Input.KeyDown (ch)
    exit when ch ('q')
    if ch (KEY_CTRL) then
        put "Ctrl!"
        delay (100)
        Input.Flush
    end if
end loop
Aziz




PostPosted: Thu Jul 14, 2005 10:54 pm   Post subject: (No subject)

Thanks, but yeah, I know Razz I don't use Input.KeyDown anyways, but I was just saying I know my program lacks the feature to ignore all possible stupid users' input

Delos wrote:
Aziz wrote:
what if they press something like CTRL?


Turing:

var ch : array char of boolean

loop
    Input.KeyDown (ch)
    exit when ch ('q')
    if ch (KEY_CTRL) then
        put "Ctrl!"
        delay (100)
        Input.Flush
    end if
end loop
Cervantes




PostPosted: Fri Jul 15, 2005 6:59 am   Post subject: (No subject)

Your final elsif should use index to determine if the key is valid or not. Say you only want to input letters (upper or lower case):

code:

loop
        if hasch then
                getch (CHAR)
                if CHAR = enterKey then
                        %handle the enter key
                elsif CHAR = rightArrow then
                        %handle the right arrow
                elsif CHAR = leftArrow then
                        %handle the left arrow
                %elsif CHAR = (some other special key that needs to be handled) then
                        %handle that special key
                elsif index ("abcdefghijklmnopqrstuvwxyz", Str.Lower (CHAR)) ~= 0 then
                        %handle correct input
                        %ie. full_input += CHAR
                end if
        end if
end loop
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 2 of 2  [ 20 Posts ]
Goto page Previous  1, 2
Jump to:   


Style:  
Search: