Skip to content

Instantly share code, notes, and snippets.

View khayyamsaleem's full-sized avatar
🏠
Working from home

khayyam khayyamsaleem

🏠
Working from home
View GitHub Profile
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);
}
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 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 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
# 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 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)
public class Calculator {
public void Calculator(){
}
public int add(int a, int b){
return a + b;
}
""" 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?")
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!'
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: ")