Skip to content

Instantly share code, notes, and snippets.

View Legend-of-iPhoenix's full-sized avatar

_iPhoenix_ Legend-of-iPhoenix

View GitHub Profile
@Legend-of-iPhoenix
Legend-of-iPhoenix / main.js
Created March 10, 2018 20:07
Enlarges ascii art.
string = document.getElementById('input').value;
/*
First string is the 'index', with escaped characters for each substitution, in order. First character = first array, second character = second array, etc.
Each array is of the format ['abc','def','ghi'], which maps to
abc
def
ghi
in the output.
*/
from sense_hat import SenseHat, ACTION_RELEASED
from signal import pause
import threading
x = 3
y = 3
xv = 1
yv = 1
sense = SenseHat()
sense.set_rotation(270)

This:

var canvas = document.createElement("canvas");
document.body.appendChild(canvas);
canvas.width = 200;
canvas.height = 200;
var theta = Math.PI/128;

var vertices = [
  [-1, -1, -1, -1],
function parse(sentence) {
var uniques = array => Array.from(new Set(array)), dict2 = []
var words = sentence.match(/.+?\b(?:\W+)?/g).filter(x => x.length)
var dict = uniques(words)
dict.push([]);
words = words.map(word => dict.findIndex(x => x == word))
words.push(dict.length - 1)
dict = dict.map(x => [x, [], []]);
words.map((x, i) => {
if (x!= dict.length - 1)
var data = `1!g!x!9k!3b!5z!k7!9k!9n!4o!4o!6b!1!4f!5z!5z!g!12l!1!ta!5z!2wd!3b!fy!1!g!5z!h!fy!fy!5z!3v2!1!gn!1!22!g!1!5z!5l!g!5l!1!9n!4f!4o!kq!381!g!5z!1bi!1p0!1v!g!5z!5z!35!22!5l!3b!5ms!2i!1vb!6b!g!4f!5l!9k!6b!1r7!3b!3b!1!9n!35!kh!pp!35!5z!5z!4o!5z!nj!rv!g!nc!g!5z!1cl!9k!3b!1!1!1bi!g!5l!4d!7vl!59k!14!1!5z!2o6!5l!1!2eu!4o!4f!1!5z!8on!6b!mm!4o!ek!5l!5l!1!5z!g!22!rv!1bi!rv!5z!x!3b!5l!9qn!rv!4o!g!4o!4f!5z!5z!6b!lx!rv!kh!9n!ta!4o!5z!5l!g!5l!5bx!3o!3b!rv!1!4o!22!5z!4o!5z!4a!ax!4f!5l!g!lx!4o!1!6b!5l!5l!g!5z!1!4f!3v2!1!9n!22!1!2i!ta!1gc!5l!5z!g!g!9n!il!b3a!rv!5l!5z!ax!pc!4o!ax!9n!35!3v2!ta!ta!g!g!35!g!g!9n!4f!rv!g!5z!5l!6b!h!6b!4o!6b!ax!1!h!1ba!9n!1!g!35!eoz!58u!g!f14!g!5wy!6b!5l!1!5z!nj!1yc!5l!4o!g!rv!5z!5l!4o!g!x!19x!6b!g!2i!6b!4d!g!6b!5z!g!sj!35!g!g!3v2!3b!5z!5z!iq!gn!ax!rv!a8!3b!3b!4o!5z!105!6b!8z@2!2!2!2!2!2!2!2!2!2!2!2!2!2!2!2!2!2!2!2!3nr!2!2!2!2!2!2!2!2!2!2!2!2!2!2!2!2!2!2!2!2!2!2!2!2!2!2!2!2!2!2!2!2!2!2!2!2!2!2!2!2!2!2!2!2!2!2!2!2!2!2!2!2!2!2!2!2!2!2!2!2!2!2!2!2!2!2!2!2!2!2!2!2!2!2!2!2!2!2!2!2!2!2!2!2!2!2!2!2!
from random import randint, seed
from math import floor
from PIL import Image
##################
# Algorithm for generating a single tile
# note that the algorithm I use to generate several tiles at once is the same in principle but steps like normalizing are done globally, as opposed to per-tile
# 1) With each pixel, generate a number based on the
# 1a) calculate the euclidean squared distance
# 1b) turn each distance into a percentage (in the inclusive range [0, 1]) of the total
// formats a duration as a human readable string, ex. "5 days, 4 minutes, and 1 second ago".
function formatDuration(ms) {
let parts = [];
const addPart = (value, maxValue, label) => {
value = Math.floor(value) % maxValue;
if (value > 0) {
parts.unshift(value + " " + label + (value === 1 ? "" : "s"));
}
}
84*111//2#_p84*162*p>"egn"v
sv="Not_in_";0//110#"befu"<+
12//2;'''[------->++<]>.+.+++++.[---->+<]>+++.-[--->++<]>-.+++++.-[->+++++<]>-.[->+++<]>++.++++.
"#'''#";print=alert,str=len=()=>0
x=1;print(sv+["js","python"+str(len("\xabc")+(1/2>0))][--x])
">$,,,,,,,$,,,,,,,@"
mod1 = 2147483563
mod2 = 2147483399
mult1 = 40014
mult2 = 40692
seed1 = 12345
seed2 = 67890
def seed(n):
global seed1, seed2, mod1, mod2
if n < 0: