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

Username:   Password: 
 RegisterRegister   
 [HELP] create a typing program
Index -> Programming, Turing -> Turing Help
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
yuhongjia




PostPosted: Sun Nov 16, 2014 3:00 pm   Post subject: [HELP] create a typing program

Typing Practice Game


I am trying to create a typing program that has letters falling from the top of the screen. The user has to type the letter correctly before it reaches the bottom of the screen. When the letter is typed correctly, a new letter appears at the top. The game ends when the user types the wrong letter or if the letter reaches the bottom of the screen, and it displays score at the end of the game.



I use "chr" and make the random letter appear on the screen, but I don't know how to make it fall from top of the screen.






Turing:


var letter : char
var number : int
randint (number, 97, 122)
letter := chr (number)

var points : int

var myFont := Font.New ("snas serif:22:bold")
Font.Draw (letter, 300, 300, myFont, blue)

var key : string (1)
loop
    if hasch then
        getch (key)
        if key = letter then
            Font.Draw (letter, 300, 300, myFont, blue)
        elsif key not= letter then
        end if
    end if
end loop
put "Your score:"
put "= ", points, " "

Sponsor
Sponsor
Sponsor
sponsor
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 1 of 1  [ 1 Posts ]
Jump to:   


Style:  
Search: