Skip to content

Instantly share code, notes, and snippets.

View indig0fox's full-sized avatar

Indigo indig0fox

View GitHub Profile
@indig0fox
indig0fox / makePsArray
Created June 1, 2018 18:39
Outputs a plain-text formatted explicity declared Powershell array from a new-line separated list of items that is pasted or manually typed by the user. Written in Python 3.6.2
# Outputs a plain-text formatted explicity declared Powershell array from a new-line separated list of items that is pasted or manually typed by the user.
# Written in Python 3.6.2.
# [email protected]
items = []
userinput = input("Please enter the first list item: ")
items.append(userinput)
i = 2
"""
--- Battleship ---
Make multiple battleships: you'll need to be careful because you need to make sure that you don’t place battleships on top of each other on the game board. You'll also want to make sure that you balance the size of the board with the number of ships so the game is still challenging and fun to play.
Make battleships of different sizes: this is trickier than it sounds. All the parts of the battleship need to be vertically or horizontally touching and you’ll need to make sure you don’t accidentally place part of a ship off the side of the board.
Make your game a two-player game.
"""
This is a game of Rock, Paper, Scissors against the computer!
"""
from random import randint
from time import sleep
options = ["R", "P", "S"]
LOSE_MESSAGE = "Sorry, better luck next time!\n"
@indig0fox
indig0fox / DiceRoll.py
Created March 4, 2018 16:34
DiceRoll.py
"""This program will allow a user to attempt to guess a randomly generated number."""
from random import randint
from time import sleep
def get_user_guess():
user_guess = int(raw_input("What's your whole-number guess? "))
return user_guess