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; | |
} |
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
#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
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> | |
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
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
;// 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(?) |
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
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 |
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 "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(); |
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
// 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 |
OlderNewer