Skip to content

Instantly share code, notes, and snippets.

View alishahwee's full-sized avatar
💻
Doing the engineering.

Alisha Hwee alishahwee

💻
Doing the engineering.
View GitHub Profile
@alishahwee
alishahwee / game.py
Created September 30, 2020 03:56
Hackbright Day 2 Lab Exercise
"""A number-guessing game."""
from random import *
# Put your code here
# Greet and prompt user
print('Howdy, what is your name?')
name = input('(type in your name) ')
print(f'{name} I\'m thinking of a number between 1 and 100. \nTry to guess my number.')
function translatePigLatin(str) {
if (/^[^aeiou]+/.test(str)) {
if (str.match(/^[^aeiou]+/)[0].length === str.length) {
return str + 'ay';
} else {
return str.replace(/(^[^aeiou]+)(\B[a-z]+)/, '$2$1ay');
}
} else {
return str + 'way';
}
const denoVals = [
{name: "ONE HUNDRED", val: 100},
{name: "TWENTY", val: 20},
{name: "TEN", val: 10},
{name: "FIVE", val: 5},
{name: "ONE", val: 1},
{name: "QUARTER", val: 0.25},
{name: "DIME", val: 0.1},
{name: "NICKEL", val: 0.05},
{name: "PENNY", val: 0.01}