Skip to content

Instantly share code, notes, and snippets.

View ikr7's full-sized avatar
🅰️
rch Linux

ikr7

🅰️
rch Linux
View GitHub Profile
@ikr7
ikr7 / calc.hs
Last active June 2, 2016 14:37
変な計算
eqz :: Integer -> Bool
eqz a = a == 0
add :: Integer -> Integer -> Integer
add a b
| eqz b = a
| otherwise = succ $ add a $ pred b
mul :: Integer -> Integer -> Integer
mul a b
@ikr7
ikr7 / a.js
Created May 31, 2016 10:21
てきとう
const succ = (a) => a + 1;
const pred = (a) => a - 1;
const add = (a, b) => {
if (b === 0) { return a; }
else { return add(succ(a), pred(b)); }
}
const mul = (a, b) => {
@ikr7
ikr7 / index.html
Created May 21, 2016 13:56
ドラゴン曲線
<!DOCTYPE html>
<html>
<head>
</head>
<body style="margin:0;overflow:hidden">
<canvas></canvas>
<script>
const canvas = document.querySelector('canvas');
const context = canvas.getContext('2d');
@ikr7
ikr7 / index.html
Created May 19, 2016 14:28
細胞
<!DOCTYPE html>
<html>
<head>
</head>
<body style="margin:0;overflow:hidden">
<canvas></canvas>
<script>
'use strict';
const W = Math.max(
@ikr7
ikr7 / prime-factrize.cpp
Created May 1, 2016 07:03
素因数分解コンソール
#include <iostream>
#include <gmpxx.h>
using namespace std;
mpz_class GCD (mpz_class m, mpz_class n) {
mpz_class t;
while (n != 0) {
t = m;
m = n;
@ikr7
ikr7 / prime-factrize.js
Created May 1, 2016 06:04
ポラード・ロー素因数分解アルゴリズム
'use strict';
const xor64 = function (y) {
y = y >>> 0;
y = y ^ (y << 13);
y = y ^ (y >> 7);
y = y ^ (y << 17);
return y >>> 0;
};
@ikr7
ikr7 / index.html
Created April 26, 2016 10:20
アニメ
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>WebGL でマンデルブロくん</title>
<style>
body {
margin:0;
overflow:hidden
@ikr7
ikr7 / index.html
Created April 20, 2016 14:53
WebGL でマンデルブロくん
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>WebGL でマンデルブロくん</title>
<style>
body {
margin:0;
overflow:hidden
@ikr7
ikr7 / index.html
Last active April 19, 2016 23:36
マンデルブロくん
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>マンデルブロくん</title>
<style>
body {
margin:0;
overflow:hidden
@ikr7
ikr7 / index.html
Created April 14, 2016 01:55
manderuburo-shuugou
<!DOCTYPE html>
<html>
<head>
<title></title>
</head>
<body>
<canvas style="width:500px;height:500px;"></canvas>
<script>
var canvas = document.querySelector('canvas');