summaryrefslogtreecommitdiff
path: root/project/templates
diff options
context:
space:
mode:
Diffstat (limited to 'project/templates')
-rw-r--r--project/templates/fltkada.html29
-rw-r--r--project/templates/grasp.html19
-rw-r--r--project/templates/thue2a.html63
3 files changed, 52 insertions, 59 deletions
diff --git a/project/templates/fltkada.html b/project/templates/fltkada.html
index 584e4f8..cea8cac 100644
--- a/project/templates/fltkada.html
+++ b/project/templates/fltkada.html
@@ -28,30 +28,29 @@ be enough to write a text editor. It's a thick, loosely coupled binding, accompl
the interface to C, then importing that to Ada. Attempted usage of the internal C interface as a binding
on its own is not supported.</p>
-<p>A typical FLTK Hello World program in Ada:
+<p>A typical FLTK Hello World program in Ada:</p>
<code>
- with
- FLTK.Widgets.Groups.Windows,
- FLTK.Widgets.Boxes;
+with
+ FLTK.Widgets.Groups.Windows,
+ FLTK.Widgets.Boxes;
- function Hello_World return Integer is
+function Hello_World return Integer is
- My_Win : FLTK.Widgets.Groups.Windows.Window :=
- FLTK.Widgets.Groups.Windows.Create (100, 100, 200, 200, "Untitled");
+ My_Win : FLTK.Widgets.Groups.Windows.Window :=
+ FLTK.Widgets.Groups.Windows.Create (100, 100, 200, 200, "Untitled");
- My_Box : FLTK.Widgets.Boxes.Box :=
- FLTK.Widgets.Boxes.Create (50, 50, 100, 100, "Hello, World!");
+ My_Box : FLTK.Widgets.Boxes.Box :=
+ FLTK.Widgets.Boxes.Create (50, 50, 100, 100, "Hello, World!");
- begin
+begin
- My_Win.Add (My_Box);
- My_Win.Show;
+ My_Win.Add (My_Box);
+ My_Win.Show;
- return FLTK.Run;
+ return FLTK.Run;
- end Hello_World;
+end Hello_World;
</code>
-</p>
<p>Aside from reworking the types to better fit the strongly typed philosophy of Ada, the entire library has
been structured to avoid explicit heap usage. As you can see from the above example, the intended use is to
diff --git a/project/templates/grasp.html b/project/templates/grasp.html
index 54e625a..c340483 100644
--- a/project/templates/grasp.html
+++ b/project/templates/grasp.html
@@ -52,18 +52,17 @@ uses a subset of the DOT graph description language for the file format, to enab
as well as relatively easy conversion to a graph image. If a format that more readily converts to a
comprehensible graph image is found, a parser for it may be added.</p>
-<p>The above example is recorded as follows:
+<p>The above example is recorded as follows:</p>
<code>
- digraph {
- 1 [label="puts"]
- 2 [label="grasp:main"]
- 3 [label="Hello world!"]
-
- 1 -> 2 [label="name"]
- 1 -> 3 [label="in"]
- }
+digraph {
+ 1 [label="puts"]
+ 2 [label="grasp:main"]
+ 3 [label="Hello world!"]
+
+ 1 -> 2 [label="name"]
+ 1 -> 3 [label="in"]
+}
</code>
-</p>
<p>Source code is available <a href="/cgit/cgit.cgi/esoteric.git/" target="_blank">here</a>.</p>
diff --git a/project/templates/thue2a.html b/project/templates/thue2a.html
index f4dac4f..6cb4680 100644
--- a/project/templates/thue2a.html
+++ b/project/templates/thue2a.html
@@ -18,18 +18,17 @@ a sequence of symbols to replace and a sequence of symbols to replace with, and
state of the program. Applicable rules are then applied to the inital state in a random
order until no more are applicable, at which point the program terminates.</p>
-<p>An example Thue program that increments a binary number surrounded by '_' characters:
+<p>An example Thue program that increments a binary number surrounded by '_' characters:</p>
<code>
- 1_::=1++
- 0_::=1
- 01++::=10
- 11++::=1++0
- _0::=_
- _1++::=10
- ::=
- _1111111_
+1_::=1++
+0_::=1
+01++::=10
+11++::=1++0
+_0::=_
+_1++::=10
+::=
+_1111111_
</code>
-</p>
<p>The before and after symbols in each rule are separated by '::=' and the list of rules is
ended by a blank rule. Note that whitespace in rules and the inital state is NOT ignored.</p>
@@ -37,26 +36,24 @@ ended by a blank rule. Note that whitespace in rules and the inital state is NOT
<p>Output is handled by prefixing the right hand side with '~', which causes those symbols to
go to stdout and the replacement in the program to be the empty string.</p>
-<p>The traditional Hello World program:
+<p>The traditional Hello World program:</p>
<code>
- a::=~Hello World!
- ::=
- a
+a::=~Hello World!
+::=
+a
</code>
-</p>
<p>Input is handled by having the right hand side of a rule be ':::', which causes the left
hand side symbols to be replaced with a line from the standard output. Unfortunately, this
immediately causes problems.</p>
<p>The following is an innocent piece of code that accepts a single line of input and does nothing
-more. Maybe.
+more. Maybe.</p>
<code>
- a::=:::
- ::=
- a
+a::=:::
+::=
+a
</code>
-</p>
<p>If a string involving the letter 'a' is entered into the above program, the single input rule
will again become applicable and another line of input will be obtained. In other words, the
@@ -67,28 +64,26 @@ version 2a. In this version, all symbols obtained through stdin are treated as d
ordinary symbols. Rules can refer to and manipulate symbols obtained through stdin by
surrounding them in double quotes.</p>
-<p>A rule that replaces an ordinary symbol 'a' with 'abc':
+<p>A rule that replaces an ordinary symbol 'a' with 'abc':</p>
<code>
- a::=abc
+a::=abc
</code>
-</p>
-<p>A rule that replaces the letter 'a' that was obtained from stdin with 'abc':
+<p>A rule that replaces the letter 'a' that was obtained from stdin with 'abc':</p>
<code>
- "a"::=abc
+"a"::=abc
</code>
-</p>
-<p>For convenience, a number of escaped characters are also available:
+<p>For convenience, a number of escaped characters are also available:</p>
<pre>
- \\ -> backslash
- \r -> return
- \n -> newline
- \: -> colon
- \" -> double quote
- \EOT -> end of file
+\\ -> backslash
+\r -> return
+\n -> newline
+\: -> colon
+\" -> double quote
+\EOT -> end of file
</pre>
-</p>
+
<p>While this doesn't solve all the problems Thue has (try writing a Thue program that asks
for and greets the user by name!) it should solve this one particular issue. Source code is