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

Username:   Password: 
 RegisterRegister   
 letter appearing individually
Index -> Programming, Turing -> Turing Help
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
cutecotton




PostPosted: Fri Jan 10, 2003 10:32 pm   Post subject: letter appearing individually

hi everyone, i'm making a typing tutor as my program. And i'm wondering (i saw someone else's program that does this, it was a demo) how do i make it so that each letter on teh word appears individually? so say i wanan make the word "hello" how do i mkae it so that the h comes, thent eh e, then the l, l, and o? I know it involves a for loop and delays..if anyone can hlep me, tks a bunch
Sponsor
Sponsor
Sponsor
sponsor
Brightguy




PostPosted: Fri Jan 10, 2003 11:37 pm   Post subject: Re: letter appearing individually

What about something like this:

code:
var word : string := "hello"

for count : 1 .. length (word)
     delay (1000)
     put word (count) ..
end for


The ".." allows the next letter to be output on the same line.
Tony




PostPosted: Sat Jan 11, 2003 2:23 am   Post subject: (No subject)

could have been my textDelay procedure Very Happy http://danco.no-ip.com/turing/viewtopic.php?t=52

textDelay colored (same link) also shows how to change colors so that letter appears in one color, then changes to another after next letter is typed. You can modify that to make letters appear in 2 colors. Such as black for what the user typed already and say blue for the letter they must press now. Also you can put in a little if statment to display typos in red Wink

This program sounds interesting, I hope you'll share it with us when its done (once again you can just submit compiled file if you don't want to share code).
Latest from compsci.ca/blog: Tony's programming blog. DWITE - a programming contest.
Brightguy




PostPosted: Sat Jan 11, 2003 1:06 pm   Post subject: Submissions

Exactly what types of programs are you looking for submissions? I've written a few odd ones here and there. Nothing that's incredibly great, in fact I view most of the code fairly primitive and unorganised. Embarassed

I've written an LED-emulator that allows you type any four letters/symbols then displays them in LED format (like the numbers on digital clocks) it's cool at first, but it gets old. Then there's the resistor colour-code decoder, a word game, a rolling ball, and a traffic light program that shows a regular traffic light and crudely determines a car's speed from the light. (If you go too fast, you crash!Smile)

Just about all of these were written in my first year of programming, so don't expect great work, but I supposed some of them are good, at least for a novelty.
azndragon




PostPosted: Sat Jan 11, 2003 4:37 pm   Post subject: (No subject)

Hmm, that's EXACTLY what I was supposed to do for my class yesterday, kinda weird if you ask me.
cutecotton




PostPosted: Tue Jan 14, 2003 1:03 am   Post subject: (No subject)

wow guys, tks so much for the reply! (was busy tehse couple days, pounding away on the computer for hte program).

I managed to get the text individually appear...and i htink that typo thing will REALLY come in handy..od u mind if i ask u for some details on it? Cuz i plan to make a test for the user. So they have to type "HELLO, my name is joe." how would i make a typo appear right hwen the user types one letter wrong?! aahh i really honestlyneed that for my program lol. I checked out the link u gave me..and got my text to go differnet colors (definitly will come in handy later on). Tony, can up lz get back to me on the typo thing asap?

I want to record the WPM (words per minute) if possible...ne1 think taht woudl be too hard? i know turing has some kinda clock/timing command, but hten again i'm not sure on it.

Once i get the program pua dn urnning (hell of a long way from that), i'll definily put it up here 4 u gu ys...tho it will be pretty huge lol.
Tony




PostPosted: Tue Jan 14, 2003 12:50 pm   Post subject: (No subject)

you can use wallclock() function to time sertain periods. Such as time one value at the beginning of typing and time another value when typing is done. Then by subtracting one from another, you'll get the time passed.

For typos, you check each letter if it matches the one needed to type.

Basically you run your loop and after each getch() you check that it equals to the letter from the sentance on current counter.

such as
code:

var word:string:="tony"
var c:string(1)
for i:1..length(word)
getch(c)
if c not=word(i) then
%typo
end if
end for
Latest from compsci.ca/blog: Tony's programming blog. DWITE - a programming contest.
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  [ 7 Posts ]
Jump to:   


Style:  
Search: