Skip to content

Instantly share code, notes, and snippets.

View LandonPowell's full-sized avatar
🏴
Nestor Makhno's Ghost 2020

Landon J. Powell LandonPowell

🏴
Nestor Makhno's Ghost 2020
View GitHub Profile
@LandonPowell
LandonPowell / CodeGolfFizzbuzz.py
Last active August 10, 2016 14:22
I FUCKING DID IT, LADS. 62 CHARS. To convert from Python2 to Python3, just add parens. They harm my golph though, so Python2 it is.
for x in range(1,101):print(x%3==0)*"Fizz"+(x%5==0)*"Buzz"or x
CLIENT.on('message', function(data){
if(((data.count+1)%100)%11==0) CLIENT.submit("STEAL");
});
CLIENT.on('message', function(data){
if(data.nick == "ThinkPad") CLIENT.submit(">>"+(data.count.toString())+" Okay kid.");
});
x = raw_input("> ")
print ' '.join(x)
for i in range(1, len(x)-1):print x[i] + (len(x) * 2 - 3) * ' ' + x[len(x)-i-1]
print ' '.join(x[::-1])
HAI 1.2
I HAS A VAR
VAR R 1
IM IN YR FIZZBUZZ UPPIN YR VAR WILE BOTH SAEM VAR AN SMALLR OF VAR AN 100
NOT MOD OF VAR AN 15
O RLY?
YA RLY, VISIBLE "FIZZBUZZ"
MEBBE NOT MOD OF VAR AN 3, VISIBLE "FIZZ"
MEBBE NOT MOD OF VAR AN 5, VISIBLE "BUZZ"
NO WAI, VISIBLE VAR
var colors = ["e66","ea6","ee6","6e6","6ee","66e","a6e"];
String.prototype.flair = function() {
flair = "$Ubuntu Mono|/^/^";
for (i = 0; i < this.length; i++) {
color = colors[i%colors.length]
flair += "##" + color + "#" + color + this[i];
}
return flair;
}
CLIENT.on('message', function() {
@LandonPowell
LandonPowell / And55clone.js
Last active February 13, 2016 23:46
This is a clone of "Make America Great Again"'s code that he wrote for my website. It generates a nick in the style of his username, "get52". I'm using LJPowell indents because they're the master race.
function randomChar(string) {
return string.charAt(Math.floor(Math.random() * string.length)) ;}
function generateName() {
var vowels = "aeiou";
var consonants = "bcdfghjklmnpqrstvwxyz";
return randomChar(consonants) +
randomChar(vowels) +
randomChar(consonants) +
(Math.floor(Math.random()*89)+10) ;}
@LandonPowell
LandonPowell / DrNim.py
Last active March 17, 2016 02:18
Python Nim Implementation.
print(
"Welcome to Nim!:\n"+
"A simple game, where you're allowed to take "+
"one, two, or three marbles from a pile of 12.\n"+
"You compete against the computer to take the "+
"last marble.")
marbles = 12
def computerTake(amount):
count = 0
string = "z"
while True:
with open(hex(count), "a+") as file:
file.write(string)
string += string
count += 1
@LandonPowell
LandonPowell / rot13.py
Created March 27, 2016 22:04
Code Golph'd implementation of rot13 in Python2.
a = "abcdefghijklmnopqrstuvwxyz"
q = " 1234567890.,'\";:"
z = {x:y for x,y in map(None,a+q,a[13:]+a[:13]+q)}
print ''.join([z[c] for c in raw_input('>').lower()])