Skip to content

Instantly share code, notes, and snippets.

View n4o847's full-sized avatar
💭
hey hey it's like like popcorn

Yuya Miura n4o847

💭
hey hey it's like like popcorn
View GitHub Profile
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
// https://github.com/hakatashi/unicue-lang
// http://unicode.org/ucd/
const fs = require("fs")
const parser = require("codepoints/parser")
const codepoints = parser("UCD")
let res = ""
let depth = 0
class Hanoi
STACK = { :A => 0, :B => 1, :C => 2 }
BYTES = { :u8 => 0, :u16 => 1, :u32 => 2, :u64 => 3 }
def pair(x, y)
a, b = STACK[x], STACK[y]
raise "" if a == b
b -= 1 if a < b
[a, b]
end
@n4o847
n4o847 / seccon2019-coffee_break.py
Created October 20, 2019 06:56
SECCON 2019 QUALS
from Crypto.Cipher import AES
import base64
def encrypt(text):
key = "SECCON"
s = ''
for i in range(len(text)):
s += chr((((ord(text[i]) - 0x20) + (ord(key[i % len(key)]) - 0x20)) % (0x7e - 0x20 + 1)) + 0x20)
return s
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>Document</title>
<style>
#disp {
push 0
loop:
push 0 readi
push 0 retrieve
dup push 10 sub jz yes:
dup push 12 sub jz yes:
dup push 14 sub jz yes:
dup push 15 sub jz yes:
dup push 16 sub jz yes:
dup push 18 sub jz yes:
,+[-
>++++++[-<-------->]
a 10
0 9 a a
a 9 a 0
a 0 r 0
+++++++++[-<[->>+>+<<<]>>>[-<<<+>>>]<<]
>[-<<+>>]<
,
git config --local user.name n4o847
git config --local user.email 22975590+n4o847@users.noreply.github.com
@n4o847
n4o847 / hanoi.rb
Created May 7, 2020 05:48
第6回東大京大コードゴルフ大会
class Hanoi
STACK = { :A => 0, :B => 1, :C => 2 }
BYTES = { :u8 => 0, :u16 => 1, :u32 => 2, :u64 => 3 }
def pair(x, y)
a, b = STACK[x], STACK[y]
raise "" if a == b
b -= 1 if a < b
[a, b]
end
@n4o847
n4o847 / hypertorus.rb
Created May 7, 2020 06:14
第6回東大京大コードゴルフ大会
def search(size)
dir = 1
mem = {}
pos = 0
id = 0
mem[0] = 0
id += 1
loop do