Skip to content

Commit 6108f43

Browse files
committed
Merge branch 'main' of github.com:rtoal/ple
2 parents 11f19d8 + 445b7c4 commit 6108f43

36 files changed

+334
-18
lines changed

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ Unix-like virtual machine if you desire to run the test scripts yourself.
4747
| Erlang | ![](docs/resources/erlang-logo-24.png) | 21 | Erlang/OTP 21 |
4848
| Factor | ![](docs/resources/factor-logo-24.png) | | |
4949
| F# | ![](docs/resources/fsharp-logo-24.png) | | |
50-
| Fortran | ![](docs/resources/erlang-logo-24.png) | | GNU Fortran (GCC) 6.1.0 |
50+
| Fortran | ![](docs/resources/fortran-logo-24.png) | | GNU Fortran (GCC) 6.1.0 |
5151
| Futhark | ![](docs/resources/futhark-logo-24.png) | | |
5252
| GDScript | ![](docs/resources/gdscript-logo-24.png) | | |
5353
| Go | ![](docs/resources/go-logo-24.png) | 1.16.4 | |
@@ -77,7 +77,7 @@ Unix-like virtual machine if you desire to run the test scripts yourself.
7777
| Odin | ![](docs/resources/odin-logo-24.png) | | |
7878
| ParaSail | | | |
7979
| Perl | ![](docs/resources/perl-logo-24.png) | 5.26.0 | |
80-
| PHP | | | |
80+
| PHP | ![](docs/resources/php-logo-24.png) | | |
8181
| Prolog | | | |
8282
| PureScript | ![](docs/resources/purescript-logo-24.png) | 0.11.5 | |
8383
| Pyth | | | |

algol68/clockhands.a68

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
FOR i FROM 0 TO 10
2+
DO INT t := (43200 * i + 21600) % 11;
3+
INT h := t % 3600;
4+
INT m := t % 60 %* 60;
5+
INT s := t %* 60;
6+
printf (($2d$, (h = 0 | 12 | h), $a$, ":", $2d$, m, $a$, ":", $2dl$, s))
7+
OD

algol68/test.ps1

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
function Assert-MatchTests {
2+
param (
3+
[Parameter(Mandatory = $true, ValueFromPipeline)] $TestResult
4+
)
5+
6+
if ($TestResult) {
7+
Write-Error "Output does not match expected results."
8+
}
9+
}
10+
11+
$Error.clear()
12+
a68g "$PSScriptRoot\clockhands.a68" |
13+
Compare-Object (Get-Content "$PSScriptRoot\..\test\clockhands_expected") |
14+
Assert-MatchTests &&
15+
a68g "$PSScriptRoot\hello.a68" &&
16+
a68g "$PSScriptRoot\roman.a68" &&
17+
a68g "$PSScriptRoot\triple.a68" |
18+
Compare-Object (Get-Content "$PSScriptRoot\..\test\triple_expected") |
19+
Assert-MatchTests &&
20+
ForEach-Object 'foo';
21+
22+
if ($Error -or !$?) {
23+
"*** ALGOL 68 TESTS FAILED ***"
24+
}
25+
else {
26+
"ALGOL 68 TESTS PASSED"
27+
}
28+
29+

algol68/triple.a68

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
FOR c TO 40
2+
DO FOR b TO c
3+
DO FOR a TO b
4+
DO IF a ** 2 + b ** 2 = c ** 2 THEN
5+
printf (($%d$, a, $2a$, ", ", $%d$, b, $2a$, ", ", $%dl$, c))
6+
FI
7+
OD
8+
OD
9+
OD

cjam/clockhands.cjam

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
B,0Bt{"%02d:"3*\[.5+43200*B/m[3600md60md]e%8Nt}/

lean/ClockHands.lean

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
def printTimes : List (IO Unit) → IO Unit
2+
| [] => pure ()
3+
| doPrint :: printStatements => do
4+
printTimes printStatements
5+
doPrint
6+
7+
def pad : Nat → String
8+
| n + 10 => s!"{n + 10}"
9+
| n => s!"0{n}"
10+
11+
def clock (t : Nat) : String :=
12+
s!"{pad (if t / 3600 == 0 then 12 else t / 3600)}:{pad (t / 60 % 60)}:{pad (t % 60)}"
13+
14+
def countdown : Nat → List (IO Unit)
15+
| 0 => []
16+
| i + 1 => IO.println (clock ((43200 * i + 21600) / 11)) :: countdown i
17+
18+
def main : IO Unit := printTimes (countdown 11)

lean/test.ps1

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
function Assert-MatchTests {
2+
param (
3+
[Parameter(Mandatory = $true, ValueFromPipeline)] $TestResult
4+
)
5+
6+
if ($TestResult) {
7+
Write-Error "Output does not match expected results."
8+
}
9+
}
10+
11+
$Error.clear()
12+
lean "$PSScriptRoot\ClockHands.lean" |
13+
Compare-Object (Get-Content "$PSScriptRoot\..\test\clockhands_expected") |
14+
Assert-MatchTests &&
15+
lean "$PSScriptRoot\Hello.lean" &&
16+
ForEach-Object 'foo'
17+
18+
if ($Error -or !$?) {
19+
"*** LEAN TESTS FAILED ***"
20+
}
21+
else {
22+
"LEAN TESTS PASSED"
23+
}

linotte/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,13 @@ choco install linotte
1212

1313
## About Linotte:
1414

15-
Linotte is an imperative, educational, French programming language. Designed to make
15+
Linotte is an imperative, educational, French programming language. Designed to make...
1616

1717
TODO
1818

1919
## Linotte Resources:
2020

21-
Continue your study of Haxe via:
21+
Continue your study of Linotte via:
2222

2323
- [Linotte Website](http://langagelinotte.free.fr/wordpress/?p=328)
2424
- [Linotte Documentation](https://github.com/cpc6128/LangageLinotte/wiki)

linotte/aiguilles_de_l_horloge.liv

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
pour chaque 11
2-
t prend sol ((joker + 0.5) * 43200 / 11)
2+
t prend sol ((43200 * joker + 21600) / 11)
33
h prend sol (t / 3600)
44
m prend sol (t / 60) mod 60
55
s prend t mod 60

livescript/README.md

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
<img src="https://raw.githubusercontent.com/rtoal/polyglot/master/docs/resources/livescript-logo-64.png">
2+
3+
# LiveScript Explorations:
4+
5+
To begin coding with LiveScript, start by installing the LiveScript compiler using this command below. Note that you need to have already installed npm before (See the JavaScript README for more details).
6+
7+
```
8+
npm install -g livescript
9+
```
10+
11+
To run a LivveScript file like hello_world.hx, go to the same directory as the file and then run the following command:
12+
13+
```
14+
lsc .\hello_world.ls
15+
```
16+
17+
You can run the tests below on Powershell below using the following command:
18+
19+
```
20+
.\test.ps1
21+
```
22+
23+
## About LiveScript:
24+
25+
LiveScript is... TODO
26+
27+
## LiveScript Resources:
28+
29+
Continue your study of LiveScript via:
30+
31+
[LiveScript GitHub](https://github.com/gkz/LiveScript)
32+
[LiveScript Documentation](https://livescript.net/)
33+
[LiveScript prelude.ls Library](https://www.preludels.com/)

0 commit comments

Comments
 (0)