Space Type 1.0 A retro typing trainer, test and game set in space

Loading...
Searching...
No Matches
Functions
spacetype_train.c File Reference

Word and Letter Typing train mode. More...

This graph shows which files directly or indirectly include this file:

## Functions
void | train ()
| main function for train mode
void | train_menu ()
| main menu for train screen
void | mode_trainletters ()
| Letter Train sub menu.
void | mode_trainwords ()
| Word Train sub menu.
void | letter_train ()
| Handles processes regarding training typing letters.
void | word_train ()
| Handles processes regarding training typing words.
void | customized_train ()
| Handles processes regarding cuztomized train mode.
void | train_select ()
| Option menu for choosing rows for both letter mode and word mode.
void | select_letter ()
| function which selects letter to display for letter train process
void | select_word ()
| function which selects words to display for word train process

## Variables
Letter Train variables
3 character arrays to store characters of respective keyboard rows.
char | TopRowLetters [10] = {'q', 'w', 'e', 'r', 't', 'y', 'u', 'i', 'o', 'p'}
char | MiddleRowLetters [9] = {'a', 's', 'd', 'f', 'g', 'h', 'j', 'k', 'l'}
char | BottomRowLetters [7] = {'z', 'x', 'c', 'v', 'b', 'n', 'm'}
char | RequiredLetter
| Stores letter which will be displayed in Letter Train process.
Word Train variables
List of Words from toprow, middlerow and bottomrow to choose from when selecting word
char | TopRowWords [][10] = {"queer", "wrought", "erode", "trope", "troupe", "youth", "utopia", "irony", "outhouse", "power"}
char | MiddleRowWords [][10] = {"lad", "slade", "glass", "fade", "grade", "hall", "jade", "klaus", "lathe"}
char | BottomRowWords [][10] = {"zoner", "xerox", "change", "vought", "broom", "noob", "mooncover"}
char * | customizedWords []
char | RequiredWord [10]
Boolean to control different modes and screen
Different booleans to control training process and also to indicatet which row is chosen for respective train modes
bool | exitTrainWords
bool | exitTrainLetters
bool | MiddleRow
bool | TopRow
bool | BottomRow
bool | exitTrainProcess
bool | letterinput
bool | exitTrain
bool | trainMode
bool | wordinput
bool | exitResult
Extern variables from main
different variables initialized before that were needed for this portion
Music | music
| background music
int | screenWidth
| screen width for graphical operations
int | screenHeight
| screen height for graphical operations
Font | retroFont
Texture2D | cockpitTexture
| Background Textures.
Texture2D | cockpitTextureKeyboard
| Background Texture.
char | wordStored [20]
| stores the presented word to later compare with fastestword and slowestword

## Detailed Description

Word and Letter Typing train mode.

Author
  Mukunda Dev Adhikari 078bc.nosp@m.t049.nosp@m..muku.nosp@m.nda@.nosp@m.pcamp.nosp@m.us.e.nosp@m.du.np

Bug:
  No Known Bug

## Function Documentation

## ◆ customized_train()

void customized_train | ( |  | ) |

Handles processes regarding cuztomized train mode.

This function is a child of word_train. So, it does everything the word_train does but the words it provides to train you are customized and contains the letters that you have typed wrong the most. It is done by storing wrongly typed letters and comparing them with the letters in the word that will be displayed.

Here is the call graph for this function:

## ◆ letter_train()

void letter_train | ( |  | ) |

Handles processes regarding training typing letters.

The function that handles resetting of variables by calling reset_counter, and contains the loop which selects the new letter (using select_letter) and a nested loop to check if the input letter matches with the displayed one.

Here is the call graph for this function:

## ◆ mode_trainletters()

void mode_trainletters | ( |  | ) |

Letter Train sub menu.

function that handles lettere practice mode. Clears all boolean relatetd rows and train loops and calls the function which draws selection menu for rows.

Here is the call graph for this function:

## ◆ mode_trainwords()

void mode_trainwords | ( |  | ) |

Word Train sub menu.

The function that handles words practice mode. Clears all boolean relatetd rows and train loops and calls the train_select function which draws selection menu for rows.

Here is the call graph for this function:

## ◆ select_letter()

void select_letter | ( |  | ) |

function which selects letter to display for letter train process

letter using the the three choices, random number generator and a switch case based on the choice and number generated. Stores that letter in RequiredLetter.

## ◆ select_word()

void select_word | ( |  | ) |

function which selects words to display for word train process

Selects a word using the the three choices, random number generator and a switch case based on the choice and number generated. Stores that word in RequiredWord.

## ◆ train()

void train | ( |  | ) |

main function for train mode

the background texture, continues the background music and calls train_menu function for further navigation

Here is the call graph for this function:

## ◆ train_menu()

void train_menu | ( |  | ) |

main menu for train screen

Draws the menu for the train mode. Gives the user the option to choose between practicing letters or practicing words.

Here is the call graph for this function:

## ◆ train_select()

void train_select | ( |  | ) |

Option menu for choosing rows for both letter mode and word mode.

This function generates the option menu for the user to choose the rows that he wants to practice. Checkbox indicator are present to indicate the rows chose. letter_train or word_train are called based on the user's previous selection

Here is the call graph for this function:

## ◆ word_train()

void word_train | ( |  | ) |

Handles processes regarding training typing words.

The function that handles resetting of variables by calling reset_counter, and contains the loop which selects the new word (using select_word) and a nested loop which ends when the user has finished enterring the word. It calls remove_firstletter each time the letter input matches the letter displayed. Once the user chooses to leave the train process, by pressing ESC, a stats screen is displayed which shows their WPM, fastest word, slowest word, etc.

Here is the call graph for this function:

## Variable Documentation

## ◆ cockpitTextureKeyboard

Texture2D cockpitTextureKeyboard
| extern

Background Texture.

Background Texture.

## ◆ customizedWords

char* customizedWords[]

Initial value:
=
{
"abstract", "conjecture", "elixir", "fervent", "gargantuan", "haphazard", "intrepid", "jubilant", "kinetic", "luminous", "maverick", "nocturnal", "orchid", "predator", "quagmire", "resilient", "saunter", "turbulent", "unwavering", "vortex", "whimsical", "xenon", "yellow", "zephyr", "allegory", "benevolent", "credence", "demeanor", "enigma", "fractal", "gusto", "hiatus", "intricacy", "jubilation", "kaleidoscope", "lucid", "magnitude", "nimble", "opulence", "pertinent", "quintessential", "responsive", "saturate", "tenacity", "unbridled", "volatile", "whirlwind", "xylophone", "yacht", "zodiac", "acumen", "bazaar", "clarity", "diligent", "empathy", "flourish", "graceful", "harmony", "intuition", "jovial", "klutz", "leverage", "mystique", "nostalgia", "overture", "persistence", "quirk", "radiance", "savvy", "transcend", "unison", "vivid", "whisper", "xylograph", "yearning", "zephyr", "affinity", "bucolic", "clandestine", "disparate", "embellish", "fluctuate", "glossary", "hiatus", "intrepid", "jubilant", "knick-knack", "legerdemain", "magnanimous", "nihilistic", "opulent", "provocative", "quintessence", "rhapsodic", "solitude", "tenacity", "unabashed", "versatility", "whirlwind", "xenophobe", "yen"
}