Skip to content

Instantly share code, notes, and snippets.

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

spaghettiSyntax spaghettiSyntax

🏠
Working from home
View GitHub Profile
@spaghettiSyntax
spaghettiSyntax / Hello.java
Created December 5, 2017 14:33
Think Java code snippets.
public class Hello {
public static void main(String[] args) {
System.out.print("Hello!\nHow are you doing?\n");
System.out.println("She said \"Hello!\" to me.");
}
}
@spaghettiSyntax
spaghettiSyntax / HelloWorld.java
Created December 5, 2017 14:41
Think Java Code Snippets
public class HelloWorld {
public static void main(String[] args) {
// generate some simple output
System.out.println("Hello, World!"); // first line
System.out.println("How are you?"); // another line
}
}
@spaghettiSyntax
spaghettiSyntax / Goodbye.java
Created December 5, 2017 14:45
Think Java code snippets.
public class Goodbye {
public static void main(String[] args) {
System.out.print("Goodbye, ");
System.out.println("cruel world");
}
}
@spaghettiSyntax
spaghettiSyntax / Time.java
Last active December 5, 2017 14:54
Think Java code snippets.
public class Time {
public static void main(String[] args) {
int hour, minute, second;
// Comments when started program, syntax when finished.
// hour = 23;
hour = 23;
// minute = 49;
@spaghettiSyntax
spaghettiSyntax / Date.java
Created December 5, 2017 15:01
Think Java code snippets.
public class Date {
public static void main(String[] args) {
String day, month;
int date, year;
day = "Friday";
date = 13;
month = "July";
@spaghettiSyntax
spaghettiSyntax / first_file.py
Created December 5, 2017 15:04
Tony Gaddis Python
#this program demonstrates some python graphic abilities
# the following URL gives a short tutorial on using the turtle
# http://www.eg.bucknell.edu/~hyde/Python3/TurtleDirections.html
# turtle is used to draw on screen
from turtle import * # star is a wildcard
# set colors: red line, blue fill
color('green', 'blue')
@spaghettiSyntax
spaghettiSyntax / orion.py
Created December 5, 2017 15:06
Tony Gaddis Python
# This program draws the stars of the Orion constellation
# the names of the stars, and the constellation lines.
import turtle
# Set the window size.
turtle.setup(500, 600)
# Set the window size.
turtle.penup()
@spaghettiSyntax
spaghettiSyntax / hitTheTarget.py
Created December 5, 2017 15:10
Tony Gaddis Python
# Anthony McCann CPW 101 10/22/17
# ch_3_jrn5_ex19.py
# Program 3-9 hit_the_target.py
# The goal of this exercise was to edit the existing
# code for the 'Hit the Target Game' on page 145.
# Hit the Target Game
import turtle
# Named constants
@spaghettiSyntax
spaghettiSyntax / skyline.py
Created December 5, 2017 15:12
Tony Gaddis Python
# Chapter 5 Exercise 26
# Anthony McCann CPW 101 11/20/17
# ch5_jrn8_ex26.py
# City Skyline
# This program draws a city skyline, stars, lighted windows.
import turtle
import random
def main():
@spaghettiSyntax
spaghettiSyntax / checkerBoard.py
Created December 5, 2017 15:18
Tony Gaddis Python
# This program makes a checkerboard pattern using functions.
import turtle
# Width of one square.
WIDTH = 60
NUM_ROWS = 8
def main():
turtle.hideturtle()