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 / main-loop.nv

0 likes
0 forks
1 files
Last active 1733534960
1 |_| Ports for reading and writing events
2 |#port, on start polling, needs, @start polling|
3 |#port, on poll input, needs, @poll input|
4 , @event keypressed
5 , @event keyreleased
6 , @event mousemoved
7 , @event mouse pressed
8 , @no events left
9
10 |#port, on quit love, needs, @quit love|
capitalex's Avatar

capitalex / zombies.nv

0 likes
0 forks
1 files
Last active 1733455882
1 player $player,
2 $player at x #400 and y #300,
3 can update for $player.
4
5 update $id, player $id?:
6 , compute player $id velocity x
7 , @is-down key a, @is-down key d
8 , compute player $id velocity y
9 , @is-down key w, @is-down key s
10 .
capitalex's Avatar

capitalex / generated-text-input.lua

0 likes
0 forks
1 files
Last active 1733374610
1 local min, max, huge = math.min, math.max, math.huge
2 local machine = {}
3
4 machine.counters = {
5 ["update scene state"] = 0,
6 ["draw scene"] = 0,
7 ["present current frame"] = 0,
8 ["sleep for 1ms"] = 0,
9 ["next cycle"] = 0,
10 ["updating scene"] = 0,
capitalex's Avatar

capitalex / generated-text-input.lua

0 likes
0 forks
1 files
Last active 1733295369
1 local min, max, huge = math.min, math.max, math.huge
2 local machine = {}
3
4 machine.counters = {
5 ["run current frame"] = 0,
6 ["step timer"] = 0,
7 ["clear the screen"] = 0,
8 ["draw scene"] = 0,
9 ["present current frame"] = 0,
10 ["sleep for 1ms"] = 0,
capitalex's Avatar

capitalex / group-etch-a-sketch.nv

0 likes
0 forks
1 files
Last active 1733204469
1 |#| new buttons row
2 |#| button, ⇐, left
3 |#| button, ⇑, up
4 |#| button, ⇓, down
5 |#| button, ⇒, right
6 |#| new buttons row
7 |#| button, Pen Down, pen down
8 |#| button, Pen Up, pen up
9 |#| new buttons row
10 |#| button, <h2 style="color:red">██</h2>, set red
capitalex's Avatar

capitalex / bouncing_ball.nv

0 likes
0 forks
2 files
Last active 1733194624 • 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 1733235262
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 1733109526
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 1733017220
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
capitalex's Avatar

capitalex / fast-counter-to-bits.nv

0 likes
0 forks
1 files
Last active 1732904003
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|
Newer Older

Powered by Opengist ⋅ Load: 295ms⋅

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