File: prism-false.html

package info (click to toggle)
node-prismjs 1.30.0%2Bdfsg%2B~1.26.5-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 19,220 kB
  • sloc: javascript: 27,628; makefile: 9; sh: 7; awk: 4
file content (52 lines) | stat: -rw-r--r-- 867 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
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>