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

All gists

Recently created
Least recently created
Recently updated
Least recently updated
june's Avatar

june / Patching A Compiled Program

0 likes
0 forks
1 files
Last active 1 year ago
Adding features to a program compiled from another language.
1 |----------------------------------------|
2
3 The section between these
4 two lines is a patch to
5 the original program.
6
7 It's intended that, as a
8 program is used, it can be
9 changed and patched as the
10 user desires.
capitalex's Avatar

capitalex / bouncing_ball.nv

0 likes
0 forks
2 files
Last active 1 year ago • Forked from yumaikas/bouncing_ball.nv
1 ||start
2 |clear__canvas_width, canvas_width| clear__canvas_width:4294967295
3 |clear__canvas_width|
4 |set_const__canvas_width__400| canvas_width:400
5 |clear__canvas_height, canvas_height| clear__canvas_height:4294967295
6 |clear__canvas_height|
7 |set_const__canvas_height__400| canvas_height:400
8 |clear__ball_radius, ball_radius| clear__ball_radius:4294967295
9 |clear__ball_radius|
10 |set_const__ball_radius__6| ball_radius:6
capitalex's Avatar

capitalex / main.lua

0 likes
0 forks
3 files
Last active 1 year ago
1 local min, max, huge = math.min, math.max, math.huge
2 local machine = {}
3
4 machine.counters = {
5 ["x:3"] = 0,
6 ["x:27"] = 1,
7 ["1"] = 0,
8 ["2"] = 0,
9 ["copy x to @number"] = 0,
10 ["print number"] = 0,
capitalex's Avatar

capitalex / zz.generated.lua

0 likes
0 forks
2 files
Last active 1 year ago
1 local min, max, huge = math.min, math.max, math.huge
2 machine.counters = {
3 ["hailstone"] = 1,
4 ["x:27"] = 1,
5 }
6 function match(counters)
7 if counters["x:6"] > 0 then
8 acc = counters["x:6"]
9 counters["x:6"] = max(counters["x:6"] - acc, 0)
10 counters["x"] = counters["x"] + acc * 6
capitalex's Avatar

capitalex / cups-bytecode-interpreter.nv

0 likes
0 forks
1 files
Last active 1 year ago
1 |move instruction pointer|
2 @instruction pointer
3
4 |fetch next instruction|
5 @decode instruction
6
7 |@current instruction is halt|
8
9 |@current instruction is inc|
10 , @increment source register
june's Avatar

june / Output.

0 likes
0 forks
2 files
Last active 1 year ago
An example of writing values out.
1 |#| constant, @io-write-out, 33
2 |#| constant, @io-write-out, 10
3
4 |!| @io-write-out:33
5 |newline| @io-write-out:10
6 |write| @io-write
7
8 ||start
9 |start|
10 write, !,
yumaikas's Avatar

yumaikas / bouncing_ball.nv

0 likes
1 forks
1 files
Last active 1 year ago
1 ||start
2 |clear__canvas_width, canvas_width| clear__canvas_width:4294967295
3 |clear__canvas_width|
4 |set_const__canvas_width__400| canvas_width:400
5 |clear__canvas_height, canvas_height| clear__canvas_height:4294967295
6 |clear__canvas_height|
7 |set_const__canvas_height__400| canvas_height:400
8 |clear__ball_radius, ball_radius| clear__ball_radius:4294967295
9 |clear__ball_radius|
10 |set_const__ball_radius__6| ball_radius:6
capitalex's Avatar

capitalex / fast-counter-to-bits.nv

0 likes
0 forks
1 files
Last active 1 year ago
1 |x to bits|
2 , fill b[3] with x:8, is b[3] filled?
3 , fill b[2] with x:4, is b[2] filled?
4 , fill b[1] with x:2, is b[1] filled?
5 , fill b[0] with x:1, is b[0] filled?
6
7 |release x, x to consume| x
8 |release x|
9
10 |consume x, x to consume|
capitalex's Avatar

capitalex / mod-24.nb

0 likes
0 forks
1 files
Last active 1 year ago
1 |make a copy of A, A| make a copy of A, duplicate A
2 |make a copy of A|
3
4 |duplicate A| A, copy of A
5
6 |is A a multiple of 24?|
7 , make a copy of A,
8 , divide the copy by 24
9 , multiply the result by 24:1000
10 , did we get the same number?:1000
sierra's Avatar

sierra / game_of_life.nv

0 likes
0 forks
1 files
Last active 1 year ago
1 ||start
2 |start| tmp_0, tmp_1, tmp_2, tmp_3, tmp_4, tmp_5, tmp_7, tmp_8, tmp_11, tmp_83, tmp_84, tmp_85, tmp_86, tmp_87, tmp_88, tmp_92, tmp_93, tmp_96, tmp_97, tmp_100, tmp_101, tmp_104, tmp_105, tmp_108, tmp_109, tmp_112, tmp_113, tmp_114, tmp_115, tmp_118, tmp_119, tmp_122, tmp_123, tmp_126, tmp_127, tmp_128, tmp_129, tmp_130, tmp_131, tmp_132, tmp_133, tmp_137, tmp_138, tmp_141, tmp_142, tmp_145, tmp_146, tmp_149, tmp_150, tmp_153, tmp_154, tmp_157, tmp_158, tmp_159, tmp_160, tmp_163, tmp_164, tmp_167, tmp_168, tmp_171, tmp_172, tmp_173, tmp_174, tmp_175, tmp_176, tmp_177, tmp_178, tmp_182, tmp_183, tmp_186, tmp_187, tmp_190, tmp_191, tmp_194, tmp_195, tmp_198, tmp_199, tmp_202, tmp_203, tmp_204, tmp_205, tmp_208, tmp_209, tmp_212, tmp_213, tmp_216, tmp_217, tmp_218, tmp_219, tmp_220, tmp_221, tmp_222, tmp_223, tmp_227, tmp_228, tmp_231, tmp_232, tmp_235, tmp_236, tmp_239, tmp_240, tmp_243, tmp_244, tmp_247, tmp_248, tmp_249, tmp_250, tmp_253, tmp_254, tmp_257, tmp_258, tmp_261, tmp_262, tmp_263, tmp_264, tmp_265, tmp_266, tmp_267, tmp_268, tmp_272, tmp_273, tmp_276, tmp_277, tmp_280, tmp_281, tmp_284, tmp_285, tmp_288, tmp_289, tmp_292, tmp_293, tmp_294, tmp_295, tmp_298, tmp_299, tmp_302, tmp_303, tmp_306, tmp_307, tmp_308, tmp_309, tmp_311, tmp_312, tmp_313,
3 |tmp_0, width| tmp_0
4 |tmp_0|
5 |tmp_1| width:15
6 |tmp_2, height| tmp_2
7 |tmp_2|
8 |tmp_3| height:15
9 |tmp_4, y| tmp_4
10 |tmp_4|
Newer Older

Powered by Opengist ⋅ Load: 247ms⋅

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