Skip to content

Instantly share code, notes, and snippets.

View jryebread's full-sized avatar

James jryebread

  • San Jose, California
View GitHub Profile
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
#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;
}
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
#include <iostream>
template <typename T> // this is the template parameter declaration
T max(T x, T y)
{
return (x > y) ? x : y;
}
int main()
#include <iostream>
#include <ctime>
#include <string>
#include <vector>
#include <fstream>
class Survivor
{
private:
std::string m_name;
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;
}