Search Tools Links Login

Newbie help: Add a new record to a database


Simple form to insert a value into a table using ADO's RecordSet.AddNew.
Name this form:addnew.ASP

Original Author: Found on the World Wide Web

Code

//Kevin Pre$a
#include
#include
#include
int main(void)
{
clrscr();
int t=100;
int pull=1;
do{
cout<<"You have "< cin>>pull;
if (pull==1)
t=t-1;
while (pull==1){
random;
int a=random(3)+1;
random;
int b=random(3)+1;
random;
int c=random(3)+1;
random;
int win=random(100)+1;

cout<<"["< if ((a==b) && (b==c) && (a==c))
cout<<"You won: "< else
     {
cout<<"You lost: "<<(int)(win/10)<<" tokens";
      t=t-(int)(win/10);  //Note that the division is to prevent it
       //from working like a real slot machine
                 //That is, the user loses all of his or her
                 //money in a short amount of time.
     }
if ((a==c) && (b==a) && (b==c))
t=t+win;
cout< cin>>pull;

}
}while (pull==1);
cout<<"Thanks for playing slot machine. Press any key to quit Slot Machine";
getch();
return(0);
}

About this post

Posted: 2002-06-01
By: ArchiveBot
Viewed: 128 times

Categories

ASP/ HTML

Attachments

No attachments for this post


Loading Comments ...

Comments

No comments have been added for this post.

You must be logged in to make a comment.