All New

user:thomas gists created by user

title:mygist gists with given title

filename:myfile.txt gists having files with given name

extension:yml gists having files with given extension

language:go gists having files with given language

topic:homelab gists with given topic

Register

Login


All New Register Login
's Avatar

capitalex

Joined 1728487741

Recently created
Least recently created
Recently updated
Least recently updated
All gists 104 Forked 1
capitalex's Avatar

capitalex / hypot.poqs

0 likes
0 forks
1 files
Last active 1738997080
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 likes
0 forks
1 files
Last active 1738992804
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 likes
0 forks
2 files
Last active 1738990209
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 likes
0 forks
1 files
Last active 1738819593
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 likes
0 forks
1 files
Last active 1738793865
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 likes
0 forks
1 files
Last active 1738214147
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 likes
0 forks
1 files
Last active 1737485783
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 likes
0 forks
1 files
Last active 1737145532
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 likes
0 forks
1 files
Last active 1736309097
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 =
capitalex's Avatar

capitalex / three-in-a-row.bytetable

0 likes
0 forks
1 files
Last active 1735921361
1 % search for 3 matching columns
2
3 ------------
4 % if we've reach the end of our spread sheet
5 % end our search in failure
6 [* 1 2]
7 [1 x 1]
8 [* 1 2 3]
9 [x -1 -1 -1]
10 ------------
Newer Older

Powered by Opengist ⋅ Load: 206ms⋅

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