Skip to content

Instantly share code, notes, and snippets.

View brentxphillips's full-sized avatar

Brent Phillips brentxphillips

  • Portland, Maine
View GitHub Profile
@brentxphillips
brentxphillips / Hello.py
Last active February 12, 2021 13:09
Gist test, Hello, runs with pythonanywhere.com/gist (see comment for url)
# Brent Phillips
# Gist and GitHub Desktop Test
# run code: https://www.pythonanywhere.com/gists/9d124642ce56a7b9a71881f3d2d39183/Hello.py/ipython3/
print("hello")
@brentxphillips
brentxphillips / turtlesquares.py
Created February 12, 2021 01:44
Basic Turtle Graphics, Squares
# Brent Phillips
import turtle as t
def goto(x, y):
t.up()
t.goto(x, y)
t.down()
def box(move, turn, color="black", fill=False, scale=1):
@brentxphillips
brentxphillips / turtlesquarerange.py
Created February 12, 2021 02:25
Draws a square using range function
# Brent Phillips
# Drawes square using range
import turtle as t
def goto(x, y):
t.up()
t.goto(x, y)
t.down()
def rangebox(move, turn, color="black", fill=False, scale=1):
@brentxphillips
brentxphillips / turtlesquaretower.py
Created February 12, 2021 03:02
Draws a tower of squares
# Brent Phillips
# Drawes square tower
import turtle as t
def goto(x, y):
t.up()
t.goto(x, y)
t.down()
def rangebox(move, turn, color="black", fill=False, scale=1):
@brentxphillips
brentxphillips / graphicsplus_circle.py
Last active February 12, 2021 14:02
Simple circle drawing used to test GraphicsPlus setup
# Brent Phillips
# CS 5001/5003 Spring 2021
# Draw circle with Graphics Plus, to test setup
# Had to download and add graphicsPlus.py file in the same directory as this file
import graphicsPlus as gr
win = gr.GraphWin("Simple Circle", 400, 400)
c = gr.Circle(gr.Point(50, 50),10)
mycircle = gr.Circle(gr.Point(100, 150), 20)
mycircle.draw(win)
@brentxphillips
brentxphillips / quiz4.py
Last active February 18, 2021 23:28
Quiz 4 code
def decline( youngNobles ):
print("Vin declines to dance with "+youngNobles.pop() )
def disappointment( suitors ):
while len(suitors) > 1:
decline( suitors )
return suitors
def theBall( characters ):
@brentxphillips
brentxphillips / two_circles.py
Created February 19, 2021 02:44
Two circles, filled plus background
# Brent Phillips
# CS 5001/5003 Spring 2021
# Two circles, background and fill
import graphicsPlus as gr
win = gr.GraphWin("Simple Circle", 400, 400)
win.setBackground("#072BB8")
mycircle = gr.Circle(gr.Point(100, 150), 20)
mycircle.setFill("black")
@brentxphillips
brentxphillips / rocks.py
Created February 19, 2021 04:11
Two rocks, background
# Brent Phillips
# CS 5001/5003 Spring 2021
# Two rocks, background and fill
import graphicsPlus as gr
win = gr.GraphWin("Simple Circle", 400, 400)
win.setBackground("#072BB8")
def rock1(x, y):
poly = gr.Polygon(gr.Point(x,y), gr.Point(x + 20,y + 10), gr.Point(x + 40,y + 30), gr.Point(x + 45,y + 42), gr.Point(x + 20,y + 80), gr.Point(x - 20,y + 80), gr.Point(x - 40,y + 40), gr.Point(x - 20,y + 20))
@brentxphillips
brentxphillips / basic_arguments.py
Last active February 24, 2021 17:28
Command line arguments example
# Brent Phillips
# CS5001/5003 Spring 2021
# Lab 3
# Instructions
# Command line arguements example
# imports system package
import sys
# if this file is run in the terminal then list prints file name with brackets aroudn it
@brentxphillips
brentxphillips / basic_inputs.py
Created February 24, 2021 18:36
Basic user input function
# bsic user inputs example
def userinput():
name = input("what's your name? ")
age = input("how old are you? ")
print("hello", name, "you are", age)
userinput()