Skip to content

Instantly share code, notes, and snippets.

View TheVoxcraft's full-sized avatar

Jonas TheVoxcraft

  • University i Oslo (USIT)
View GitHub Profile
@TheVoxcraft
TheVoxcraft / telnetserver.py
Created December 25, 2015 11:22
Python Socket Telnet Chat Room (Python 3.5.1)
import socket
import sys
from _thread import *
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
clients = []
host = ''
port = 23
chat = ""
print("\n"*50)
@TheVoxcraft
TheVoxcraft / Terrain_Generation.pde
Created July 3, 2015 09:57
Random Terrain Generation in Java (Processing)
int windowX = 800; //Default 800 X 600
int windowY = 600;
int[] terrain = new int[windowX];
int count = 2;
int start;
int temp_z;
void setup(){
background(0,0,0);
frameRate(10000);
@TheVoxcraft
TheVoxcraft / Double_Bubble_Sorting.pde
Created July 2, 2015 12:21
Double Bubble Sorting
int windowX = 800; //Default 800 X 600
int windowY = 600;
int swaps = 0;
int[] stack = new int[windowX]; // P-1
String algorithm = "Double Bubble Sorting";
int passes = 0;
boolean passed = false;
int counter = 1;
int temp;
@TheVoxcraft
TheVoxcraft / Bubble_Sorting.pde
Last active August 29, 2015 14:24
Bubble Sorting mad ein Processing, VOX 2015
int windowX = 800; //Default 800 X 600
int windowY = 600;
int swaps = 0;
int[] stack = new int[windowX];
String algorithm = "Bubble Sorting";
int passes = 0;
boolean passed = false;
int counter = 1;
int temp;
int old_swaps;
void keyPressed() { //Controls
//println(keyCode);
if (key == CODED) {
if (keyCode == UP) {
direction = "up";
accelerate = true;
} if (keyCode == DOWN) {
direction = "down";
@TheVoxcraft
TheVoxcraft / 1pastebot.py
Last active November 19, 2021 23:45
PasteBin Bot with Pastebin API 1.6
#Python 3.4
import random
import string
import time
from pastebin import PastebinAPI
x = PastebinAPI()
DEV_KEY1 = '475b38cdfbba7a92d8bde6c56adfb241' #primary key
@TheVoxcraft
TheVoxcraft / name_gen.py
Created May 25, 2015 12:21
Name Fetcher 1.2
#Python 3.4
import requests
from bs4 import BeautifulSoup
def spider(max_refresh):
file = open("names_generated.txt","w")
file.close()
file = open("names_generated.txt","a")
@TheVoxcraft
TheVoxcraft / SchoolSystem.py
Created May 25, 2015 12:19
School System Official Release 2.4
#Python 3.4
import pickle
pupil = []
def menu():
print("\n*****************CLASS REGISTER*****************")
print("Press 1 See The List Of Pupils")
print("Press 2 To Add New Pupils")
print("Press 3 To Remove Pupils")
@TheVoxcraft
TheVoxcraft / boot.py
Created May 3, 2015 16:58
Python OS - Command Line Interface Operating System (needs an folder named 'usr' in same directory)
# -*- coding: utf-8 -*-
print("Loading OS...")
from datetime import datetime
import os
import re
import sys
import cl_apps
current_time = datetime.now().time()
@TheVoxcraft
TheVoxcraft / name_generator.py
Last active August 29, 2015 14:19
Name Generator with interchanging system for vowels and consonants. Review 1
import random
import re
alphabet1 = ("a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z")
alphabet2 = ("b","c","d","f","g","h","j","k","l","m","n","p","q","r","s","t","v","w","x","z")
alphabet3 = ("a","e","i","o","u","y")
length = 7 # Length of word.
c_length = 0