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
class List { | |
constructor(array) { | |
this.array = array; | |
} | |
get first() { | |
return this.array[0]; | |
} | |
get tail() { |
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
console.log(array( | |
(y => | |
(unit => | |
(no_use => | |
(yes => | |
(no => | |
(when => | |
(not => |
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
let lt = (f => (x => f(n => x(x)(n)))(x => f(n => x(x)(n))))(m => l => f => (_ => _)((l => l(_ => _ => (_ => f => f(_ => _))))(l))(_ => (_ => (f => _ => f(_ => _))))(_ => (h => t => (l => r => f => f(l)(r))(h)(t))(f((p => p(l => _ => l))(l)))(m((p => p(_ => r => r))(l))(f))))((e => (l => (f => (x => f(n => x(x)(n)))(x => f(n => x(x)(n))))(v => r => l => (_ => _)((l => l(_ => _ => (_ => f => f(_ => _))))(l))(_ => r)(_ => v((h => t => (l => r => f => f(l)(r))(h)(t))((p => p(l => _ => l))(l))(r))((p => p(_ => r => r))(l))))(_ => (f => _ => f(_ => _)))(l))(e(_ => _ => (f => _ => f(_ => _)))))((f => (x => f(n => x(x)(n)))(x => f(n => x(x)(n))))(r => t => h => (_ => _)((n => n(_ => (_ => f => f(_ => _)))(_ => f => f(_ => _)))(h))(_ => t)(_ => r((h => t => (l => r => f => f(l)(r))(h)(t))(h)(t))))(_ => (f => _ => f(_ => _)))(f => x => f(x))(f => x => f(f(x)))(f => x => f(f(f(x))))))(e => (m => n => n(n => (p => p(l => _ => l))(n(p => (l => r => f => f(l)(r))((p => p(_ => r => r))(p))((n => f => x => f(n(f)(x)))((p = |
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
// 完全不使用 undefined | |
let y = f => (x => f(n => x(x)(n)))(x => f(n => x(x)(n))); | |
let yes = f => y => f; | |
let no = x => f => f; | |
let when = c => c; | |
let not = b => b(no)(yes); | |
let undef = _ => no; |
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
let yes = f => y => f(); | |
let no = x => f => f(); | |
let not = b => b(() => no)(() => yes); | |
let when = c => c; | |
let undef = (_ => _)(); | |
// 系統邊界 ... 在這邊就是借助 JavaScript 執行環境,這讓事情簡單一些 |
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
function array(lt) { | |
let yes = f => y => f(); | |
let no = x => f => f(); | |
let when = c => c; | |
let undef = (_ => _)(); | |
let is_undef = n => n === undef ? yes : no; | |
let pair = l => r => f => f(l)(r); | |
let left = p => p(l => _ => l); |
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
let y = f => (x => f(x(x)))(x => f(x(x))); | |
let z = f => (x => f(n => x(x)(n)))(x => f(n => x(x)(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
function array(lt) { | |
let pair = l => r => f => f(l)(r); | |
let left = p => p(l => r => l); | |
let right = p => p(l => r => r); | |
let nil = pair(undefined)(undefined); | |
let con = head => tail => pair(head)(tail); | |
let head = lt => left(lt) | |
let tail = lt => right(lt); |
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
//radius determines the size of the hexagon | |
radius = 20; | |
levels = 15; | |
spacing = 2; | |
thickness = 20; | |
module hexagons(radius, spacing, levels) { | |
beginning_n = 2 * levels - 1; | |
offset_x = radius * cos(30); |
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
'''碎形數列之一…每隔 n 個空格填入數字1、2、3、4、5 ....,例如 n 為 2 時… | |
1 _ _ 2 _ _ 3 _ _ 4 _ _ 5 _ _ 6 _ _ 7 _ _ 8 _ _ 9 _ _ .... | |
接著,在上面的數列中,每隔 2 個空格填入數字1、2、3、4、5 .... | |
1 1 _ 2 _ 2 3 _ _ 4 3 _ 5 _ 4 6 _ _ 7 5 _ 8 _ 6 9 _ _ .... | |
繼續在上面的數列中,每隔 2 個空格填入數字1、2、3、4、5 .... |