This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
BubbleSort PROC | |
;//performs the bubble sort algorithm | |
;//recieves ESI: offset of myarray and ECX: The length | |
push eax | |
L1: | |
mov eax, [esi] | |
mov edx, [esi + 4] | |
cmp edx, eax | |
jg swapo | |
jmp ending |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
void bubbleSort(int *myarray, int length); | |
int main() | |
{ | |
int myarray[10] = { 1,2,7,9,8,6,4,5,4,3}; | |
bubbleSort(myarray, 10); | |
for (int x = 0; x < 10; x++) | |
std::cout << myarray[x] << std::endl; | |
return 0; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from random import randint | |
loop = True | |
bankValue = 40.00 | |
while (loop == True): | |
print (bankValue) | |
print("Please enter your guess for the next roll") | |
print("It only costs $2.00 to play. If you ar ecorrect I will pay u 2") | |
realNum = randint(0, 6) | |
guessNum = input("Guess Number: ") | |
bankValue -= 2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
template <typename T> // this is the template parameter declaration | |
T max(T x, T y) | |
{ | |
return (x > y) ? x : y; | |
} | |
int main() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
#include <ctime> | |
#include <string> | |
#include <vector> | |
#include <fstream> | |
class Survivor | |
{ | |
private: | |
std::string m_name; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
string Player::bountySelect() //function to call upon for a new random name from list | |
{ | |
string Random; | |
string bountyName[10] = { "Carth Terek", "Strilath Trammer", "Opuurin Horle","Boone Fremlin", | |
"Graeme Verbenti", "Dia Jyvun", "Lynorri Cage", "Luna Kaiser","Ulaire Arlos" }; | |
srand(time(NULL)); | |
int randNum = rand() % 9; | |
Random = bountyName[randNum]; | |
return Random; | |
} |
NewerOlder