-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
13 changed files
with
307 additions
and
1 deletion.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
(function (Prism) { | ||
/** | ||
* Based on the manual by Wouter van Oortmerssen. | ||
* | ||
* @see {@link https://github.com/PrismJS/prism/issues/2801#issue-829717504} | ||
*/ | ||
Prism.languages['false'] = { | ||
'comment': { | ||
pattern: /\{[^}]*\}/ | ||
}, | ||
'string': { | ||
pattern: /"[^"]*"/, | ||
greedy: true | ||
}, | ||
'character-code': { | ||
pattern: /'[\S\s]/, | ||
alias: 'number' | ||
}, | ||
'assembler-code': { | ||
pattern: /\d+`/, | ||
alias: 'important' | ||
}, | ||
'number': /\d+/, | ||
'operator': /[-!#$%&'*+,./:;=>?@\\^_`|~ßø]/, | ||
'punctuation': /\[|\]/, | ||
'variable': /[a-z]/, | ||
'non-standard': { | ||
pattern: /[()<BDO®]/, | ||
alias: 'bold' | ||
} | ||
}; | ||
}(Prism)); |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
<h2>Hello, world!</h2> | ||
|
||
<pre><code>"Hello, world!"</code></pre> | ||
|
||
<h2>Lambda functions</h2> | ||
|
||
<h3>Increment</h3> | ||
|
||
<pre><code>5 [7+]! . {Outputs 12.}</code></pre> | ||
|
||
<h3>Square numbers</h3> | ||
|
||
<pre><code>[$*] s: 7s;! . {Outputs 49.}</code></pre> | ||
|
||
<h2>Conditions</h2> | ||
|
||
<h3>Equal, less, or greater than</h3> | ||
|
||
<pre><code>5x: | ||
7y: | ||
x;y;= | ||
$ | ||
x; | ||
. | ||
[" equals "]? | ||
~[ | ||
x;y;> | ||
$ | ||
[" is greater than "]? | ||
~[" is less than "]? | ||
]? | ||
y; | ||
.</code></pre> | ||
|
||
<h2>Loops</h2> | ||
|
||
<h3>English alphabet</h3> | ||
|
||
<pre><code>'Ai: 'Zm: 1m;+ m: [m;i;>][i;, 1i;+ i:]#</code></pre> | ||
|
||
<h3>Ten Green Bottles</h3> | ||
|
||
<pre><code>[$ . " green bottle" 1> ["s"]? ". | ||
"] f: | ||
10n: [n;0>][n;f;! n;1- n:]#</code></pre> | ||
|
||
<h2>User input</h2> | ||
|
||
<h3>Reverse a string</h3> | ||
|
||
<pre><code>"Enter the string character by character (or a space to finish): | ||
"0i: [ß ^ $ 32=~][i;1+ i:]# % "Reverse: " [i;0>][, i;1- i:]#</code></pre> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
0` | ||
65535` | ||
|
||
---------------------------------------------------- | ||
|
||
[ | ||
["assembler-code", "0`"], | ||
["assembler-code", "65535`"] | ||
] | ||
|
||
---------------------------------------------------- | ||
|
||
Checks for assembler codes. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
' | ||
' | ||
' | ||
'' | ||
|
||
---------------------------------------------------- | ||
|
||
[ | ||
["character-code", "'\n"], ["character-code", "'\t"], | ||
["character-code", "' "], | ||
["character-code", "''"] | ||
] | ||
|
||
---------------------------------------------------- | ||
|
||
Checks for character codes. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
{ | ||
} | ||
{!#$%&'*+,-./:;=>?@[\]^_`|~ßø} | ||
{""} | ||
{foo} | ||
{{} | ||
{} | ||
{}{} | ||
{}} | ||
|
||
---------------------------------------------------- | ||
|
||
[ | ||
["comment", "{\n}"], | ||
["comment", "{!#$%&'*+,-./:;=>?@[\\]^_`|~ßø}"], | ||
["comment", "{\"\"}"], | ||
["comment", "{foo}"], | ||
["comment", "{{}"], | ||
["comment", "{}"], | ||
["comment", "{}"], ["comment", "{}"], | ||
["comment", "{}"], "}" | ||
] | ||
|
||
---------------------------------------------------- | ||
|
||
Checks for comments. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
! | ||
# | ||
$ | ||
% | ||
& | ||
* | ||
+ | ||
, | ||
- | ||
. | ||
/ | ||
: | ||
; | ||
= | ||
> | ||
? | ||
@ | ||
\ | ||
^ | ||
_ | ||
` | ||
| | ||
~ | ||
ß | ||
ø | ||
|
||
---------------------------------------------------- | ||
|
||
[ | ||
["operator", "!"], | ||
["operator", "#"], | ||
["operator", "$"], | ||
["operator", "%"], | ||
["operator", "&"], | ||
["operator", "*"], | ||
["operator", "+"], | ||
["operator", ","], | ||
["operator", "-"], | ||
["operator", "."], | ||
["operator", "/"], | ||
["operator", ":"], | ||
["operator", ";"], | ||
["operator", "="], | ||
["operator", ">"], | ||
["operator", "?"], | ||
["operator", "@"], | ||
["operator", "\\"], | ||
["operator", "^"], | ||
["operator", "_"], | ||
["operator", "`"], | ||
["operator", "|"], | ||
["operator", "~"], | ||
["operator", "ß"], | ||
["operator", "ø"] | ||
] | ||
|
||
---------------------------------------------------- | ||
|
||
Checks for operators. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
[ | ||
] | ||
|
||
---------------------------------------------------- | ||
|
||
[ | ||
["punctuation", "["], | ||
["punctuation", "]"] | ||
] | ||
|
||
---------------------------------------------------- | ||
|
||
Checks for punctuation marks. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
" | ||
" | ||
"!#$%&'*+,-./:;=>?@[\]^_`|~ßø" | ||
"" | ||
"""" | ||
"foo" | ||
"{}" | ||
|
||
---------------------------------------------------- | ||
|
||
[ | ||
["string", "\"\n\""], | ||
["string", "\"!#$%&'*+,-./:;=>?@[\\]^_`|~ßø\""], | ||
["string", "\"\""], | ||
["string", "\"\""], ["string", "\"\""], | ||
["string", "\"foo\""], | ||
["string", "\"{}\""] | ||
] | ||
|
||
---------------------------------------------------- | ||
|
||
Checks for strings. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
a | ||
b | ||
c | ||
d | ||
e | ||
f | ||
g | ||
h | ||
i | ||
j | ||
k | ||
l | ||
m | ||
n | ||
o | ||
p | ||
q | ||
r | ||
s | ||
t | ||
u | ||
v | ||
w | ||
x | ||
y | ||
z | ||
zzz | ||
|
||
---------------------------------------------------- | ||
|
||
[ | ||
["variable", "a"], | ||
["variable", "b"], | ||
["variable", "c"], | ||
["variable", "d"], | ||
["variable", "e"], | ||
["variable", "f"], | ||
["variable", "g"], | ||
["variable", "h"], | ||
["variable", "i"], | ||
["variable", "j"], | ||
["variable", "k"], | ||
["variable", "l"], | ||
["variable", "m"], | ||
["variable", "n"], | ||
["variable", "o"], | ||
["variable", "p"], | ||
["variable", "q"], | ||
["variable", "r"], | ||
["variable", "s"], | ||
["variable", "t"], | ||
["variable", "u"], | ||
["variable", "v"], | ||
["variable", "w"], | ||
["variable", "x"], | ||
["variable", "y"], | ||
["variable", "z"], | ||
["variable", "z"], ["variable", "z"], ["variable", "z"] | ||
] | ||
|
||
---------------------------------------------------- | ||
|
||
Checks for variables. |