473,796 Members | 2,595 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Typing Tutor Program?

1 New Member
I have a problem making a typing tutor program in c.. im using djgpp and running on a windows xp.

my problem is that, how can i be able to let the letters/number fall at the same time.
example: the rand() function generated the letter a and is now falling on gotoxy(5,1).. now what i want is that while it is falling on (5,1) i want to have another fall at the same time on for example on gotoxy (12,1)..

how will i be able to do that? thanks a lot for those who would help. :)

here is my code.


#include<stdio. h>
#include<conio. h>
#include<time.h >

main()
{
int nDiff;
int nY=0;
int nX=0;
int nLet;
int nCounter=0;
time_t seconds;

//width x=80 y =25
//intro page

clrscr();
gotoxy(32,10);
printf("TYPING TUTOR\n");
gotoxy(27,15);
printf("PRESS ENTER TO CONTINUE");
getch();

//difficulty menu

clrscr();
{
gotoxy(22,9);
printf("[1] - EASY (alphabet)\n");
gotoxy(22,11);
printf("[2] - AVERAGE (alphabet & numbers)\n");
gotoxy(22,13);
printf("[3] - DIFFICULT (all types of characters)\n") ;
gotoxy(19,20);
printf("Choose Difficulty: ");
}
scanf("%d", &nDiff);
clrscr();

if(nDiff==1)
{
gotoxy(1,5);
printf("--------------------------------------------------\n");
for(nCounter=1; nCounter<=2; nCounter++)
{
nX=srand(time(& seconds))%100;
while(nX>50)
{
nX=nX%25;
}


nLet=srand(time (&seconds))%100 ;
while(nLet<64|| nLet>89&&nLet<9 7||nLet>122)
{
nLet=nLet%10+65 ;
}

for(nY = 6; nY < 20; nY++)
{
if(nLet<64||nLe t>89)
{
gotoxy(nX,nY);
textcolor(10);
cprintf("%c", nLet);
gotoxy(60,50);
sleep(1);
gotoxy(nX,nY);
printf(" ");
gotoxy(60,50);
}
else if(nLet<97||nLe t>122)
{
gotoxy(nX,nY);
textcolor(14);
cprintf("%c", nLet);
gotoxy(1,20);
printf("--------------------------------------------------\n");
gotoxy(60,50);
sleep(1);
gotoxy(nX,nY);
printf(" ");
gotoxy(60,50);
}
}

}
getch();
return 0;
}

else if(nDiff==2)
{
gotoxy(1,5);
printf("--------------------------------------------------\n");
for(nCounter=1; nCounter<=2; nCounter++)
{
nX=srand(time(& seconds))%100;
while(nX>50)
{
nX=nX%25;
}


nLet=srand(time (&seconds))%100 ;
while(nLet<64|| nLet>89&&nLet<9 7||nLet>122&&nL et>=0||nLet<=9)
{
nLet=nLet%10+65 ;
}

for(nY = 6; nY < 20; nY++)
{
if(nLet<64||nLe t>89)
{
gotoxy(nX,nY);
textcolor(10);
cprintf("%c", nLet);
gotoxy(60,50);
sleep(1);
gotoxy(nX,nY);
printf(" ");
gotoxy(60,50);
}
else if(nLet<97||nLe t>122)
{
gotoxy(nX,nY);
textcolor(14);
cprintf("%c", nLet);
gotoxy(1,20);
printf("--------------------------------------------------\n");
gotoxy(60,50);
sleep(1);
gotoxy(nX,nY);
printf(" ");
gotoxy(60,50);
}
else if(nLet>=0||nLe t<=9)
{
gotoxy(nX,nY);
textcolor(11);
cprintf("%d", nLet);
gotoxy(1,20);
printf("--------------------------------------------------\n");
gotoxy(60,50);
sleep(1);
gotoxy(nX,nY);
printf(" ");
gotoxy(60,50);
}

}

}
getch();
return 0;
}

else if(nDiff==3)
{
gotoxy(1,5);
printf("--------------------------------------------------\n");
for(nCounter=1; nCounter<=2; nCounter++)
{
nX=srand(time(& seconds))%100;
while(nX>50)
{
nX=nX%25;
}


nLet=srand(time (&seconds))%100 ;
while(nLet<64|| nLet>89&&nLet<9 7||nLet>122)
{
nLet=nLet%10+65 ;
}

for(nY = 6; nY < 20; nY++)
{
if(nLet<64||nLe t>89)
{
gotoxy(nX,nY);
textcolor(10);
cprintf("%c", nLet);
gotoxy(800,30);
sleep(1);
gotoxy(nX,nY);
printf(" ");
gotoxy(800,30);
}
else if(nLet<97||nLe t>122)
{
gotoxy(nX,nY);
textcolor(14);
cprintf("%c", nLet);
gotoxy(1,20);
printf("--------------------------------------------------\n");
gotoxy(60,50);
sleep(1);
gotoxy(nX,nY);
printf(" ");
gotoxy(60,50);
}
}

}
getch();
return 0;
}
}
Aug 5 '06 #1
0 3132

Sign in to post your reply or Sign up for a free account.

Similar topics

49
3126
by: bearophileHUGS | last post by:
Adding Optional Static Typing to Python looks like a quite complex thing, but useful too: http://www.artima.com/weblogs/viewpost.jsp?thread=85551 I have just a couple of notes: Boo (http://boo.codehaus.org/) is a different language, but I like its "as" instead of ":" and "->", to have: def min(a as iterable(T)) as T: Instead of:
3
1232
by: administrata | last post by:
i'm using tutor maling... i e-mail some questions to tutor and get answers. but, i frequently get mails which aren't related with my question. how should i stop it?
2
1605
by: Henry | last post by:
I can provide the following assitance: 1. PROGRAMMING PROJECT (Student projects are welcome) or, 2. COMPUTER TUTOR (Java, Visual C++ 6, C++ (UNIX), Using Computer, Internet, Windows, etc) 3. MISCELLANEOUS COMPUTER SOFTARE/HARDWARE QUESTIONS Trusted and experienced software programmer graduated with a degree of B.S. in Computer Science. My current location is in New York City,
3
2374
by: visual basic dummy | last post by:
I have taken a course at the local college. It is called Advanced Languages and this course will cover C++, Perl and Javascript. I must pass this course. In January/Feb we covered a 1000+page textbook. It has been more than 3 years since I took C language. I have already written my final exam for C++ and just barely passed with a 65%. I have a project that is due on 25 March. I really need someone to sit with me to do this project. I need...
2
3532
by: zheenma | last post by:
There is a program that speed up your typing and avoid spelling errors. My friends use it ,their averege is more than 100 wpm. You can download it from www.wamasoft.com. And It has a library for c++. I hope that it can help you!
4
2079
by: Throw | last post by:
G'day everyone! I would like to design typing tutor exercises for Afrikaans (and other languages possibly). This is for a GPL project. For this, I need a script that can extract words from a long list of words, based on which letters those words contain, and write then write output to a file. Does anyone know of an existing script for this, or can anyone write me one, please? Preferably I must be able to extract words which contain...
0
1553
by: Marian Heddesheimer | last post by:
Rent-a-Tutor.com is in search for testers as online-courses students. As operators of rent-a-tutor.com we are proud to offer high quality online courses over the internet at reasonable prices. At the moment, our courses are all available in German. These courses have proven themselves to be very user-friendly and understandable on the German market. So starting January 2006, we will provide them in English as well. All of my courses...
2
2079
by: tavspamnofwd | last post by:
Referred here from the tutor list. ---------- Forwarded message ---------- From: Evert Rol Hi Tom, Ok, I wasn't on the list last year, but I was a few days ago, so persistence pays off; partly, as I don't have a full answer.
0
1694
by: Ezra Taylor | last post by:
Joseph: Check out subprocess. The subprocess module is on python 2.4. Also, use subprocess.call("your command",shell=True) On Linux/Unix, the process is below import subprocess ret = subprocess.call("dir",shell=True,stdout=open('/dev/null','w'),stderr=subprocess.STDOUT)
0
9679
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9527
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10223
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10172
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9050
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
6785
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5573
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4115
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
2924
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.