diff --git a/CS161/5.11.2016/a.out b/CS161/5.11.2016/a.out new file mode 100755 index 0000000..ff2a86b Binary files /dev/null and b/CS161/5.11.2016/a.out differ diff --git a/CS161/5.11.2016/functions.cpp b/CS161/5.11.2016/functions.cpp new file mode 100644 index 0000000..dbccc28 --- /dev/null +++ b/CS161/5.11.2016/functions.cpp @@ -0,0 +1,19 @@ +#include +using namespace std; + +int toInt(char input); +bool isVowel(char c); + +int main(){ + char a = 'a'; + cout << toInt(a); + + +return 0; +} + +int toInt(char input){ + return static_cast(input); +} + + diff --git a/CS161/lab8/lab7.cpp b/CS161/lab8/lab7.cpp new file mode 100644 index 0000000..b6f2786 --- /dev/null +++ b/CS161/lab8/lab7.cpp @@ -0,0 +1,33 @@ +#include +#include +using namespace std; +/* + +inFile.open(filePath.c_str(), ios::binary); + +inFile.seekg(0, ios_base::end); +int fileLen = inFile.tellg(); +inFile.seekg(0, ios_base::beg); + +inFile.read(charArr, fileLen); +inFile.close(); + +*/ + +int fileSize(ifstream file); + +int main() { + + fstream file; + file.open("test.txt"); + cout << fileSize(file); + file.close(); + + return 0; +} + +int fileSize(ifstream file){ + return 0; +} + + diff --git a/CS161/lab8/template.cpp b/CS161/lab8/template.cpp new file mode 100644 index 0000000..2a454f6 --- /dev/null +++ b/CS161/lab8/template.cpp @@ -0,0 +1,9 @@ +#include +using namespace std; + +int main() { + + + +return 0; +} diff --git a/CS161/lab8/test.txt b/CS161/lab8/test.txt new file mode 100644 index 0000000..2178a28 --- /dev/null +++ b/CS161/lab8/test.txt @@ -0,0 +1,2 @@ +this is a test +this is a test diff --git a/monkthecoder/cardshuffle.py b/monkthecoder/cardshuffle.py new file mode 100644 index 0000000..73ffb60 --- /dev/null +++ b/monkthecoder/cardshuffle.py @@ -0,0 +1,7 @@ +import random as rnd + +picks = ['2 of hearts','3 of spades','ace of spades','king of hearts','7 of clubs'] + +print(rnd.randint(0,1) * len(picks)) + + diff --git a/teachingpython/blackjack/__pycache__/cards.cpython-35.pyc b/teachingpython/blackjack/__pycache__/cards.cpython-35.pyc new file mode 100644 index 0000000..6f47df5 Binary files /dev/null and b/teachingpython/blackjack/__pycache__/cards.cpython-35.pyc differ diff --git a/teachingpython/blackjack/cards.py b/teachingpython/blackjack/cards.py new file mode 100644 index 0000000..24c96ab --- /dev/null +++ b/teachingpython/blackjack/cards.py @@ -0,0 +1,53 @@ +cards = ['5 of hearts', + '8 of hearts', + '2 of hearts', + '9 of hearts', + 'queen of hearts', + 'ace of hearts', + '6 of hearts', + 'king of hearts', + '7 of hearts', + 'jack of hearts', + '4 of hearts', + '10 of hearts', + '3 of hearts', + '5 of spades', + '8 of spades', + '2 of spades', + '9 of spades', + 'queen of spades', + 'ace of spades', + '6 of spades', + 'king of spades', + '7 of spades', + 'jack of spades', + '4 of spades', + '10 of spades', + '3 of spades', + '5 of diamonds', + '8 of diamonds', + '2 of diamonds', + '9 of diamonds', + 'queen of diamonds', + 'ace of diamonds', + '6 of diamonds', + 'king of diamonds', + '7 of diamonds', + 'jack of diamonds', + '4 of diamonds', + '10 of diamonds', + '3 of diamonds', + '5 of clubs', + '8 of clubs', + '2 of clubs', + '9 of clubs', + 'queen of clubs', + 'ace of clubs', + '6 of clubs', + 'king of clubs', + '7 of clubs', + 'jack of clubs', + '4 of clubs', + '10 of clubs', + '3 of clubs'] + diff --git a/teachingpython/blackjack/test.py b/teachingpython/blackjack/test.py new file mode 100644 index 0000000..2e1e049 --- /dev/null +++ b/teachingpython/blackjack/test.py @@ -0,0 +1,3 @@ +import importlib +import_module('cards') +