or
or
By clicking below, you agree to our terms of service.
New to HackMD? Sign up
Syntax | Example | Reference | |
---|---|---|---|
# Header | Header | 基本排版 | |
- Unordered List |
|
||
1. Ordered List |
|
||
- [ ] Todo List |
|
||
> Blockquote | Blockquote |
||
**Bold font** | Bold font | ||
*Italics font* | Italics font | ||
~~Strikethrough~~ | |||
19^th^ | 19th | ||
H~2~O | H2O | ||
++Inserted text++ | Inserted text | ||
==Marked text== | Marked text | ||
[link text](https:// "title") | Link | ||
 | Image | ||
`Code` | Code |
在筆記中貼入程式碼 | |
```javascript var i = 0; ``` |
|
||
:smile: | ![]() |
Emoji list | |
{%youtube youtube_id %} | Externals | ||
$L^aT_eX$ | LaTeX | ||
:::info This is a alert area. ::: |
This is a alert area. |
On a scale of 0-10, how likely is it that you would recommend HackMD to your friends, family or business associates?
Please give us some advice and help us improve HackMD.
Do you want to remove this version name and description?
Syncing
xxxxxxxxxx
Bring to Another
Sample programs
[S0] Rule 110
This outputs a rule 110 triangle and crashes after 100 iterations
[S1] Stdin
This reads stdin until EOF
[S2] FizzBuzz
This repeatedly checks if counter (whatever that is) is divisible by either 5 or 3 in an infinite loop.
An alternate and more likely interpretation of the original description would say that
it independantly checks for
% 5 == 0
and% 3 == 0
, making it have two outputs (the choice of the numbers 3 and 5 supports this, since then it becomes FizzBuzz except there's no output)[S3] Hello World
A hello world
The bytes might be in the wrong orderthis is very clear since in other text programs we have in reverse order[S4] Modulo
Checks if 3 is divisible by 3.
Discarded
This program is believed to be and unfinished version of S2 that likely doesn't work
[S5] truth-machine
The original description is as follows:
[S6] this thing
is a tape setup for some turing machine.
The note says that is uses substacks and "subsets"
[S7] null
This program is called "null". It likely creates an empty object of some kind
[S8] check if odd
checks if user input is odd or not
[S9] the K combinator
creates a function P that will take a input A and a input x and will output a function that will always return x
[S10] oprimized truth-machine
a optimized version of the truth-machine
Other artifacts
Some notes found say:
A TODO list says:
A
notes.txt
says:A
weird_features.txt
says:a logo:

Observations
%
s in S0-
and+
are, they are not arithmetic operations<
and>
do not cancel eachotherKnown facts
/
is a commentn 000 =
acts asgoto line n
000= whatever
Known instructions
Current assumptions
/colors:
comment is erroneous, and the following line is actually part of the previous step (A5)[...]
makes some sort of sub-stackLikely instructions
Addresses
Hypotheses
[...]
creates a sub-stack[...]
is related to memory/memory
&
is related to memory/memory
0 000 =
&[...]
is a special syntax unrelated to[...]
[a][b][c]
is unrelated to[...]
Because this'd complicate everything way too much
DEC
decrementsV
which is related to memory in some way{E}
is brainfuck loop(...)
is a function applicationn(E)
=λE.n E
wheren
is a church numeral where the function we applyn
times is taken as first argumentAnalysis of S7 and S6
This checks if an input is odd or even and prints "true" or "false" in response
This is supposed to be equivalent to a K combinator, (
λxλA.x
), bound toP
per the descriptionThe first program, according to what we know, can be broken down as follows:
(A)/(B)
seems to be it's own structure unrelated to(E)
./
has only ever appeared alone or in that context, and(E)
being a function application, should be invalid at the start of the program.The
-
is responsible for some sort of input processing.The
()/(2)
causes a modulus by 2And the rest is explained.
However
(A)/(B)
has to be a pretty generic structure and not specifically modulus, since it also shows up in the K combinator:Fortunately it is known that
P
,x
, anda
are names here.If
(E)
is an application, then at the surface it looks like the prior code creates a function that binds the a function to the argument. It would seem logical ifλ
was responsible for that, but that is a guess.?
does not appear anywhere else..
appears in only one other program.It is also worth bringing
into the analysis, as it also is related to modulus and has this structure