1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85
|
]
#include <iostream>
#include <fstream>
#include <vector>
#include <ctime>
#include"dos.h"
#include "windows.h"
#include <time.h>
#include <stdio.h>
#include <time.h>
struct timeval tv;
time_t seconds;
using namespace std;
int A;
vector <string> possible_answers();
int alphabet[27] = {1,3,3,2,1,4,2,4,1,8,5,1,3,1,1,3,10,1,1,1,1,4,4,8,4,10}; //to assign value to each letter of the alphabet according to scrabble rules
int SetTimer(struct timeval &tv, time_t sec)
{
time_t seconds;
seconds = time (NULL);
tv.tv_sec=seconds;
tv.tv_sec+=sec;
return 1;
}
int CheckTimer(struct timeval &tv, time_t sec)
{
struct timeval ctv;
time_t seconds;
seconds = time (NULL);
ctv.tv_sec=seconds;
//printf ( "Current seconds: %ld\n", seconds );
if( (ctv.tv_sec > tv.tv_sec) )
{
return 1;
}
else
return 0;
}
char char_to_point(char *letter){//need to have defined array above because this methods serves to purposes:
return 0;
}
int main() {
string correctword();
int i;
string a;
SetTimer(tv,5); //set up a delay timer
cout<<"Welcome to Text Twist \n you will have 2 and a half minutes to give in in every possible word from"<<endl;
cout<<endl;
cout<<"Here is your first"<<endl;
while(CheckTimer(tv,5) !=1)
{
seconds = time (NULL);
i++;
while(a != correctword){
cin>>a;
}
cout<<"TIME: "<<i;
system("cls");
}
cout<<"done"<<endl;
system("pause");//pauses program, prevents from closing
return 0;
}
|