Skip to content

DGCK81LNN/setincrementor

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Fast SetIncrementor interpreter

Stores only the deltas of adjacent numbers, ensuring time efficiency:

  • increment all numbers and add 1 into set: O(1)
  • increment nth number: O(n) if a duplicate is generated, otherwise O(1)

How to use

Run the executable and input code to stardard input.

Double dash (--) introduces single line comments.

Memory is dumped when program halts. Pass --debug in the command line to trace each instruction.

Example program

Simulation of Minsky machine calculating 2 + 5:

1 2 3
3 2 3 2    -- inc x (*2)
3 3 3 3 3  -- inc y (*5)
[a]        -- label a
2 e 3 4 5 [s] 3 t [q] 3 p 2 2 1 1 1 END [p] 2 q [t] 2 1 s [e] 1  -- tdec y,END
3 2        -- inc x
a          -- goto a
[END]      -- label END

Result: 9 17 18 (x=7, y=0)

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages