This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) => { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<head> | |
</head> | |
<body style="margin:0;overflow:hidden"> | |
<canvas></canvas> | |
<script> | |
const canvas = document.querySelector('canvas'); | |
const context = canvas.getContext('2d'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<head> | |
</head> | |
<body style="margin:0;overflow:hidden"> | |
<canvas></canvas> | |
<script> | |
'use strict'; | |
const W = Math.max( |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#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; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
'use strict'; | |
const xor64 = function (y) { | |
y = y >>> 0; | |
y = y ^ (y << 13); | |
y = y ^ (y >> 7); | |
y = y ^ (y << 17); | |
return y >>> 0; | |
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="UTF-8"> | |
<title>WebGL でマンデルブロくん</title> | |
<style> | |
body { | |
margin:0; | |
overflow:hidden |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="UTF-8"> | |
<title>WebGL でマンデルブロくん</title> | |
<style> | |
body { | |
margin:0; | |
overflow:hidden |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="UTF-8"> | |
<title>マンデルブロくん</title> | |
<style> | |
body { | |
margin:0; | |
overflow:hidden |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<head> | |
<title></title> | |
</head> | |
<body> | |
<canvas style="width:500px;height:500px;"></canvas> | |
<script> | |
var canvas = document.querySelector('canvas'); |