This file contains hidden or 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
const generatePlayerBoard = (numberOfRows, numberOfColumns) => { | |
let board = []; | |
for(let numberOfRowsIndex=0; numberOfRowsIndex < numberOfRows; numberOfRowsIndex++){ | |
let row =[]; | |
for (let numberOfColumnsIndex = 0; numberOfColumnsIndex < numberOfColumns; numberOfColumnsIndex++) { | |
row.push(' '); | |
} | |
board.push(row); | |
} |
This file contains hidden or 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
const generatePlayerBoard = (numberOfRows, numberOfColumns) => { | |
let board = []; | |
for(let numberOfRowsIndex=0; numberOfRowsIndex < numberOfRows; numberOfRowsIndex++){ | |
let row =[]; | |
for (let numberOfColumnsIndex = 0; numberOfColumnsIndex < numberOfColumns; numberOfColumnsIndex++) { | |
row.push(' '); | |
} | |
board.push(row); | |
} |
This file contains hidden or 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
"""This is a guessing game about rolling dice, summing the total and comparing to a guess. HOPKINS August 16th, 2017""" | |
from random import randint | |
from time import sleep | |
def get_user_guess(): | |
user_guess = int(raw_input("Guess a number between 2 and 12")) | |
return user_guess |
This file contains hidden or 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
"""This is a guessing game about rolling dice, summing the total and comparing to a guess. HOPKINS August 16th, 2017""" | |
from random import randint | |
from time import sleep | |
def get_user_guess(): | |
user_guess = int(raw_input("Guess a number between 2 and 12")) | |
return user_guess |
This file contains hidden or 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
# help user calculate area of shapes | |
from math import pi | |
from time import sleep | |
from datetime import datetime | |
now = datetime.now() | |
print "calculator is starting up" | |
print ('%s/%s/%s %s:%s') % (now.month , now.day , now.year , now.hour , now.minute) | |
sleep(1) | |
hint = "Don't forget to include the correct units!\nExiting" | |
option = raw_input("enter C for Circle or T for Triangle: ") |
This file contains hidden or 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
""" | |
This program will allow a user to calculate the area of any shape chosen | |
""" | |
from math import pi | |
from time import sleep | |
from datetime import datetime | |
now = datetime.now() | |
print "Starting the calculator..." | |
print "Current time:%s/%s/%s%s:%s" % (now.month, now.day, now.year, now.hour, now.minute) | |
sleep(1) |
This file contains hidden or 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
public class Calculator { | |
public void Calculator(){ | |
} | |
public int add(int a, int b){ | |
return a + b; | |
} |
This file contains hidden or 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
""" This program is a mad libs story and my name is Krystal it prompts the user for input and prints the entire mad libs story with the user's input in the right place | |
""" | |
print("Mad Libs is now starting") | |
name=raw_input("What is your main characters name?") | |
adjective_1=raw_input("What is your first adjective?") | |
adjective_2=raw_input("What is your second adjective?") | |
adjective_3=raw_input("What is your third adjective?") | |
verb_1=raw_input("What is your first verb?") | |
verb_2=raw_input("What is your second verb?") | |
verb_3=raw_input("What is your third verb?") |
This file contains hidden or 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
spanish = ['envoltorio' , 'plazo', 'atisbo', 'manojo', 'costra'] | |
for w in spanish: | |
print w | |
if w == 'envoltorio': | |
print w + " is the chosen word" | |
break | |
else: | |
print 'Other words were not chosen!' |
This file contains hidden or 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
print "Mad Libs is starting!" | |
name = raw_input("Enter a name: ") | |
Adjective1 = raw_input("Enter an adjective: ") | |
Adjective2 = raw_input("Enter a second adjective: ") | |
Adjective3 = raw_input("Enter a third adjective: ") | |
Verb1 = raw_input("Enter a verb: ") | |
Verb2 = raw_input("Enter a second verb: ") |