Skip to content

Instantly share code, notes, and snippets.

View mousetail's full-sized avatar
💭
Working on discord bot

Maurits van Riezen mousetail

💭
Working on discord bot
View GitHub Profile
@mousetail
mousetail / knight.js
Last active August 24, 2022 08:22 — forked from Steffan153/knight.js
Bubbler version of Knight, forked from Seffan
const fs = require('node:fs');
const input = String.fromCharCode(...fs.readFileSync(0)).split('\n');
const source = fs.readFileSync('source.knight', 'utf8');
const Knight = (() => {
let inputs = [];
let output = '';
class KnightError extends Error {}
class ParseError extends KnightError {}
class RuntimeError extends KnightError {}
use bevy::prelude::*;
use bevy::render::camera::{Camera, OrthographicProjection, PerspectiveProjection};
use bevy_rapier3d::prelude::*;
use bevy::render::pass::ClearColor;
use bevy_flycam::{FlyCam, PlayerPlugin};
fn main() {
App::build()
class Multiset():
def __init__(self, name):
self.name = name
self.fixed_items = {}
self.nrof_items = 0
def add(self, item):
self.fixed_items[item] = self.fixed_items.get(item, 0)+1
self.nrof_items+=1
def remove(self, item):
if self.fixed_items.get(item, 0) > 0:
const allowedNodeTypes = [
'p',
'span',
'div',
'a',
'img',
'h1',
'h2',
'h3',
'h4',
@mousetail
mousetail / gl.py
Last active October 1, 2018 10:17
import OpenGL.GL as GL
import OpenGL.GL.shaders
import pygame
import math
import random
import PIL
import colorsys
vertex_shader = """
#version 330
import csv
import json
import pygame
import random
# Data source:
# http://ec.europa.eu/eurostat/data/database?p_p_id=NavTreeportletprod_WAR_NavTreeportletprod_INSTANCE_nPqeVbPXRmWQ&p_p_lifecycle=0&p_p_state=normal&p_p_mode=view&p_p_col_id=column-2&p_p_col_pos=1&p_p_col_count=2#
# The three consituent graphs can be generated by tweaking the constants
# uses "abbreviations.json" from https://github.com/samayo/country-json/blob/master/src/country-by-abbreviation.json
# only with an added "uk" for united kingdom, since the original uses GB
import random
class Number:
def __str__(self):
return str(random.randint(0, 2**random.randint(1,8)+1))
words = ['move', 'write', 'him', 'mark', 'gave', 'often', 'red', 'never', 'ever', 'great',
'second', 'money', 'old', 'keep', 'produce', 'remember', 'problem', "don't", 'laugh', 'make',
'might', 'beauty', 'while', 'off', 'same', 'other', 'real', 'place', 'first', 'warm', 'be',
'people', 'tell', 'size', 'sun', 'north', 'under', 'head', 'too', 'dog', 'differ', 'go',
# python3.5
import itertools
def isIn(group, elem):
elem=''.join(sorted(set(elem[0]))),''.join(sorted(set(elem[1])))
for s in group:
if s[0]==elem[0]:
for g in elem[1]:
if g not in s[1]:
#python 3.5
#requires pygame and numpy
#loads a map from "Interactive website/worldMapBlue.png"
#saves result to "Interactive website/blue-world-map.png"
import pygame
import pygame.gfxdraw
import numpy
import math
from math import cos, sin
#2d_anim.py
#Maurits van Riezen (mousetail)
#23 November 2015
#Requires python 3 and pygame for python 3
import pygame
import random
import itertools
import os