Skip to content

Instantly share code, notes, and snippets.

View jryebread's full-sized avatar

James jryebread

  • San Jose, California
View GitHub Profile
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;
}
#include <iostream>
#include <ctime>
#include <string>
#include <vector>
#include <fstream>
class Survivor
{
private:
std::string m_name;
#include <iostream>
template <typename T> // this is the template parameter declaration
T max(T x, T y)
{
return (x > y) ? x : y;
}
int main()
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>
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;
}
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
@jryebread
jryebread / asm
Last active April 18, 2017 05:20
;// James Riback
;// CSIS-118B-4639
;// 4/9/17
;// Practice 11
INCLUDE c:\Irvine\Irvine32.inc
.data
msg1 BYTE "Please input the array element number that defines the boundary between the first and second part of the array<0 to 16>:", 0dh, 0ah, 0
msg2 BYTE "Here is the array with random numbers up to FFh in the first part and up to FFFFh in the second part:", 0dh, 0ah, 0
myarray WORD 16 DUP(?)
template<class T>
void LinkedList<T>::deleteElement(T currVal)
{
Node<T> *p = Head;
//Stop at the node before the one you want to delete
while (p->next->data != currVal)
{
p = p->next;
}
//set up the next node for deletion
#include "PalCheck.h"
#include "Queue.h"
#include <string>
bool PalCheck::isPalindrome(Queue<char> pq)
{
std::string nline = "";
std::string rline = "";
int n = pq.ifront();
int r = pq.iback();
// Recursion - James Riback
package recursionones;
public class RecursionOnes {
static int getOnes(int num, int count) // number of times the value 1 appears in a number converted to binary
{
if(num >0)
{
count = num % 2 == 1 ? count + 1 : count; // if the remainder is equal to 1, we count it