No description
concentration | ||
hangman | ||
palindrome | ||
tic_tac_toe | ||
yahtzee_roller | ||
README.md |
First Lines
These are the very first lines of code I ever wrote. Think in the realm of less than T+10 hours programming. While there were many wonderful design decisions made, I have highlighted some of the better ones below.
Highlights
./palindrome/palindrome.cpp
int true_false=0;
// ...
if (true_false==1)
{
// ...
}
else
{
// ...
}
string in_word;
int x=0;
int length=0;
// ...
getline(cin, in_word, '\n');
length = in_word.size();
char palindrome[length+1];
palindrom[length+1]=NULL;
while(x<length)
{
palindrome[x] = in_word[x];
x++;
}
./yahtzee_roller/yahtzee_roller.cpp
int current_dice[6];
Yahtzee is only played with five dice...
./concentration/concentration.cpp
char chars[10];
chars[0] = 'A';
chars[1] = 'B';
chars[2] = 'C';
chars[3] = 'D';
chars[4] = 'E';
chars[5] = 'F';
chars[6] = 'G';
chars[7] = 'H';
chars[8] = 'I';
chars[9] = 'J';
// ...
switch(output[0])
{
case 0:
cout << chars[0];
break;
case 1:
cout << chars[1];
break;
case 2:
cout << chars[2];
break;
case 3:
cout << chars[3];
break;
case 4:
cout << chars[4];
break;
case 5:
cout << chars[5];
break;
case 6:
cout << chars[6];
break;
case 7:
cout << chars[7];
break;
case 8:
cout << chars[8];
break;
case 9:
cout << chars[9];
break;
}
Additionally, I did not know I could write functions (nor by extension how to). So that switch statement is copy pasted about...40 times :) The file is over 7000 lines long...