全部 新建

user:thomas 由使用者建立的 Gists

title:mygist Gists 的標題

filename:myfile.txt Gists 的檔案名稱

extension:yml Gists 的副檔名

language:go Gists 的程式語言

topic:homelab gists with given topic

註冊

登錄


全部 新建 註冊 登錄
's Avatar

capitalex

加入 1 year ago

倒序排序 創建
順序排序 創建
倒序排序 更新
順序排序 更新
所有 Gists 115 分支 1
capitalex's Avatar

capitalex / main.lua

0 喜歡
0 分支
3 檔案
最後活躍 10 months ago
1 local pprint = require "pprint"
2 local QueueMap = require "queue-map"
3 local the_eye = require "the-eye"
4
5 -- knowledge base
6 local kb = QueueMap.new()
7
8 for _, pixel in ipairs(the_eye) do
9 kb:enqueue("image $image $x $y $r $g $b", {"eye", pixel[4], pixel[5], pixel[1], pixel[2], pixel[3]})
10 end
capitalex's Avatar

capitalex / hypot.poqs

0 喜歡
0 分支
1 檔案
最後活躍 10 months ago
1 { [#port] [@add (x) and (y) into (where)] =>
2 [% push(vars.where, vars.x + vars.y) %] }
3
4 { [#port] [@square root of (x) into (where)] =>
5 [% push(vars.where, math.sqrt(vars.x)) %] }
6
7 { [#port] [@write (mesage)] =>
8 [% io.write(vars.message) %] }
9
10 { [hypotenuse of (a) and (b)] =>
capitalex's Avatar

capitalex / fizzbuzz.factor

0 喜歡
0 分支
1 檔案
最後活躍 10 months ago
1 USING: io kernel math math.functions math.parser ranges
2 sequences ;
3 IN: rosetta-code.fizz-buzz
4
5 PREDICATE: fizz < integer 3 divisor? ;
6 PREDICATE: buzz < integer 5 divisor? ;
7
8 INTERSECTION: fizzbuzz fizz buzz ;
9
10 GENERIC: fizzbuzz>string ( n -- str )
capitalex's Avatar

capitalex / path-bag.lua

0 喜歡
0 分支
2 檔案
最後活躍 10 months ago
1 love = love or {}
2 local pprint = require "pprint"
3
4 --[[
5 If you are familiar with jargon, then a "path bag" is
6 a muliset that is implemented as a prefix tree.
7
8 this is a path
9 this is another path
10 this is a final path
capitalex's Avatar

capitalex / moonlets.lua

0 喜歡
0 分支
1 檔案
最後活躍 10 months ago
1 -- slow, inefficient, and partial implemention of a fraglets
2 -- interpreter. Basically enough to run a factorial program
3 -- Also, I changed the syntax.
4 local fraglets = {}
5 local function print_pool()
6 print("--- fraglets ---")
7 for i, fraglet in ipairs(fraglets) do
8 print(table.concat(fraglet, " "))
9 end
10 print()
capitalex's Avatar

capitalex / heap-sort.modal

0 喜歡
0 分支
1 檔案
最後活躍 10 months ago
1 <> (?: print) (?:)
2
3 <> ((Num ?x) (Num ?y) '<) (?((?0 ?1 ?:) ((Bool ?:))) ?x ?y <)
4
5 <> ((Bool 1) if ?a ?b) (?a)
6 <> ((Bool 0) if ?a ?b) (?b)
7
8 <> (Empty ?x meld) (?x)
9 <> (?x Empty meld) (?x)
10 <> ((H (?x) (L ?h)) (H (?y) (L ?j)) meld) (
capitalex's Avatar

capitalex / luneur.lua

0 喜歡
0 分支
1 檔案
最後活躍 10 months ago
1 local net, live = {}, {}
2
3 local function neuron(name)
4 if not net[name] then
5 net[name] = {
6 name = name,
7 alive = false, sleep = false,
8 arity = 0, saturation = 0,
9 excite = {},
10 inhibit = {},
capitalex's Avatar

capitalex / mutable-stack.mth

0 喜歡
0 分支
1 檔案
最後活躍 10 months ago
1 module float-buffer.main
2
3 import std.prelude
4 import std.world
5 import std.buffer
6 import std.maybe
7
8 struct +Stack(a) {
9 +buffer: +Buffer
10 top: IOffset
capitalex's Avatar

capitalex / alta.lua

0 喜歡
0 分支
1 檔案
最後活躍 10 months ago
1 local function tokenize(string)
2 local tokens, current_symbol, current_token = {}, {}, {}
3
4 local function push_token()
5 if #current_token ~= 0 then
6 table.insert(current_symbol, table.concat(current_token))
7 current_token = {}
8 end
9 end
10
capitalex's Avatar

capitalex / search-for-value.triplicate

0 喜歡
0 分支
1 檔案
最後活躍 11 months ago
1 = requests =
2 restore - group - $group
3 restore - field - $field
4 temporary - $group - $value
5 = response =
6 restore - group - $group
7 restore - field - $field
8 $group - $field - $value
9
10 = request =
上一頁 下一頁

由 Opengist 提供支持 ⋅ Load: 229ms⋅

繁體中文
Čeština Deutsch English Español Français Magyar Italiano 日本語 Polski Português Русский Türkçe Українська 中文 繁體中文