Skip to content

Instantly share code, notes, and snippets.

View wynand1004's full-sized avatar

Christian Thompson wynand1004

View GitHub Profile
@wynand1004
wynand1004 / JavaLoopChallenge2.java
Created March 25, 2021 00:56
Java Loop Challenge 2 Starter Code
// Java Loop Challenge 2
// By @TokyoEdtech
class JavaLoopChallenge2
{
public static void main(String[] args)
{
System.out.println("\n\n1.");
// Create a loop to print the numbers 1 to 10 inclusive
@wynand1004
wynand1004 / JavaLoopChallenge1.java
Created March 25, 2021 00:55
Java Loop Challenge 1 Starter Code
// Java Loop Challenge 1
// By @TokyoEdtech
class JavaLoopChallenge1
{
public static void main(String[] args)
{
String text = "";
String letter = "";
System.out.println("\n\n1.");
@wynand1004
wynand1004 / patterns_to_loops.py
Last active October 21, 2020 05:38
Patterns to Loops Starter Code
# Finding Patterns
import os
os.system("clear")
# 1
print(1)
print(2)
print(3)
print(4)
print(5)
@wynand1004
wynand1004 / simple_text_adventure.py
Created October 10, 2019 11:22
Simple Text Adventure Game in Python
# http://christianthompson.com
# Twitter: @tokyoedtech
# Welcome to my "office hours" for October 10, 2019.
# If you have any Python questions - ask in chat
# Please provide any code via pastebin.com link
# OS: Ubuntu Linux 19.04
# Programming Editor: Geany
#Asteroids by @TokyoEdTech / Written in Python 3.5
#Part 0: Finished Demo
import os
import random
import time
import math
#Import the Turtle module
import turtle
@wynand1004
wynand1004 / 2048_alpha.py
Created December 11, 2018 22:55
An simple Python implementation of the game 2048 written in Python 3.
# 2048 in Python 3 for Beginners (Alpha Version)
# By @TokyoEdTech
import turtle
import random
# Set up the screen
wn = turtle.Screen()
wn.title("2048 by @TokyoEdTech")
wn.bgcolor("black")
@wynand1004
wynand1004 / snake_game.py
Created September 2, 2018 08:56
A Simple Snake Game made in Python 3
# Simple Snake Game in Python 3 for Beginners
# By @TokyoEdTech
import turtle
import time
import random
delay = 0.1
# Score
@wynand1004
wynand1004 / inspiration.py
Created August 11, 2018 00:13
A simple inspirational saying rotating app written in Python 3 and using tkinter.
# Inspirational Sayings
# By @TokyoEdTech YouTube Channel: https://www.youtube.com/channel/UC2vm-0XX5RkWCXWwtBZGOXg
import tkinter
import random
root = tkinter.Tk()
root.title("Inspiration")
root.geometry("225x75")
lbl_inspiration = tkinter.Label(root, wraplength=200)
@wynand1004
wynand1004 / machine_print.py
Created August 1, 2018 14:02
Simple printing function to print one letter at a time in classic computer style!
import time
def machine_print(text, delay = 0.1):
for letter in text:
print(letter, end="", flush=True)
time.sleep(delay)
print()
machine_print("Greetings, Professor Falken. Shall we play a game?")
@wynand1004
wynand1004 / string_probability_challenge.py
Last active March 14, 2018 07:53
Something I saw on Reddit and decided to give a try. Link in header.
# Coding Challenge
# Reddit: https://www.reddit.com/r/learnprogramming/comments/847ckg/i_failed_a_coding_interview_but_then_afterwards/
# The problem was given a file of sentences, one sentence per line,
# implement a function that takes in 2 words, prob(a, b),
# and outputs the probability of a occurring given that the
# preceding word is b.
# Some test data already in a list with punctuation removed
sentences = ["Please buy me a drink",
"Please buy me a drink Bob",