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 1 year ago

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

capitalex / square.lua

0 likes
0 forks
1 files
Last active 6 months ago
1 require "prelude"
2 local function _zt()
3 local y, x = POP(''), POP('')
4 PUSH('', x * y)
5 end
6 local function _zp()
7 local y, x = POP(''), POP('')
8 PUSH('', x + y)
9 end
10 local function _sqrt()
capitalex's Avatar

capitalex / prelude.lua

0 likes
0 forks
1 files
Last active 6 months ago
1 local function push(self, value)
2 self.n = self.n + 1
3 table.insert(self, value)
4 end
5
6 local function pop(self)
7 local value = self[self.n]
8 self[self.n] = nil
9 self.n = self.n - 1
10 return value
capitalex's Avatar

capitalex / queue.ml

0 likes
0 forks
1 files
Last active 7 months ago
1 (* Chris Okasaki
2 School of Computer Science
3 Carnegie Mellon University
4 Pittsburgh, PA 15213
5 cokasaki@cs.cmu.edu *)
6
7 functor HoodMelvilleQueue () : QUEUE =
8 (* Alternative implementation of queues with O(1) worst-case *)
9 (* performance. Provided for comparison. *)
10 (* *)
capitalex's Avatar

capitalex / rpn.lua

0 likes
0 forks
2 files
Last active 7 months ago
1 local function rpn_caculator()
2 local char = io.read(1)
3 local acc, op = nil, {}
4 local data_stack = {}
5 while char do
6 if char:match("%s") then
7 if #op ~= 0 then
8 local op_to_eval = table.concat(op)
9 op = {}
10 if op_to_eval == "+" then
capitalex's Avatar

capitalex / zombies.mira

0 likes
0 forks
2 files
Last active 7 months ago
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 / map.nv

0 likes
0 forks
1 files
Last active 7 months ago
1 ||
2 :: map :list: (1 2 3 4 5 6 7) :into: x
3 :with: x = x + 1
4 :with: x = x ^ 2
5 :with: x = x * 3
6
7 |:: map? :list: $x :into: $var?|
8 :@variables: set $var $x :@variables:
9 :: wait for @variables
10 :: apply operations
capitalex's Avatar

capitalex / fizzbuzz.nv

0 likes
0 forks
2 files
Last active 7 months ago
1 || :: fizzbuzz :n: 1 :max: 100
2
3 |:: fizzbuzz :n: $n? :max: $m?|
4 :: as long as $n is not greater than $m :: then
5 :: $n is a multiple of 3 :: then
6 :: it's a fizz number
7 :: $n is a multiple of 5 :: then
8 :: it's a buzz number
9 :: end
10 :: else :: $n is a multiple of 5 :: then
capitalex's Avatar

capitalex / BaseLoader.gd

0 likes
0 forks
1 files
Last active 7 months ago
1 extends Node
2 class_name BaseLoader
3
4 var items = {}
5
6 var TYPES := []
7 var RESOURCE_DIR := ""
8 var RECURSIVE := true
9 var _resources_to_load := []
capitalex's Avatar

capitalex / hello-world.inlang.nils.nv

0 likes
0 forks
1 files
Last active 7 months ago
1 |:: documentation for NILS Form|
2 :@doc string:
3 "Nova In-Language Static Form is a possible structure for lowering
4 Nova code into a bytecode language describable in Nova. This is not
5 intended to be written by hand."
6
7 |:@data stack: reset? :@data seen: $stack $value|
8 :@data: $stack $value
9 |:@data stack: reset|
capitalex's Avatar

capitalex / hello-world.nils.jets.nv

0 likes
0 forks
1 files
Last active 7 months ago
1 |:: documentation for NILS Form|
2 :@doc string:
3 "Nova In-Language Static Form is a possible structure for lowering
4 Nova code into a bytecode language describable in Nova. This is not
5 intended to be written by hand."
6
7 |:: match $stack $arity :failed:?|
8 |:: match $stack $symbol|
9 :@jet:
10 "
Newer Older

Powered by Opengist ⋅ Load: 198ms⋅

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