You might be interested.
I made a simple algorithm, intentionally brute force with CASE.
The task is: The algorithm must find the order on which the LWK3724 code is located. Start numbering AAA0000, AAA0001, AAA0002... etc.
The alphabet is classic. 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.
The correct answer is: 80183725.
I did exactly the same algorithm in 24 languages. Here are the results, for what time (in seconds) each language found this number on the same PC.
It looks like Pure is not at this very convenient, but Spider is doing great!
P.S. It's not a complete test of languages. This is a solution to one particular example. Intentionally "example of life", not a textbook example of recursion..
Here is the code in PB:
Code: Select all
Global p.i
Global x.i=-1
Global a1.i,a2.i,a3.i
Global ps1.s,ps2.s,ps3.s
Global h1.s,h2.s,h3.s
Global h.i
h1="L"
h2="W"
h3="K"
h=3724
Repeat
x+1
p+1
If x>9999
x=0
a3+1
If a3>25
a3=0
a2+1
If a2>25
a2=0
a1+1
EndIf
EndIf
EndIf
Select a1
Case 0
ps1="A"
Case 1
ps1="B"
Case 2
ps1="C"
Case 3
ps1="D"
Case 4
ps1="E"
Case 5
ps1="F"
Case 6
ps1="G"
Case 7
ps1="H"
Case 8
ps1="I"
Case 9
ps1="J"
Case 10
ps1="K"
Case 11
ps1="L"
Case 12
ps1="M"
Case 13
ps1="N"
Case 14
ps1="O"
Case 15
ps1="P"
Case 16
ps1="Q"
Case 17
ps1="R"
Case 18
ps1="S"
Case 19
ps1="T"
Case 20
ps1="U"
Case 21
ps1="V"
Case 22
ps1="W"
Case 23
ps1="X"
Case 24
ps1="Y"
Case 25
ps1="Z"
EndSelect
Select a2
Case 0
ps2="A"
Case 1
ps2="B"
Case 2
ps2="C"
Case 3
ps2="D"
Case 4
ps2="E"
Case 5
ps2="F"
Case 6
ps2="G"
Case 7
ps2="H"
Case 8
ps2="I"
Case 9
ps2="J"
Case 10
ps2="K"
Case 11
ps2="L"
Case 12
ps2="M"
Case 13
ps2="N"
Case 14
ps2="O"
Case 15
ps2="P"
Case 16
ps2="Q"
Case 17
ps2="R"
Case 18
ps2="S"
Case 19
ps2="T"
Case 20
ps2="U"
Case 21
ps2="V"
Case 22
ps2="W"
Case 23
ps2="X"
Case 24
ps2="Y"
Case 25
ps2="Z"
EndSelect
Select a3
Case 0
ps3="A"
Case 1
ps3="B"
Case 2
ps3="C"
Case 3
ps3="D"
Case 4
ps3="E"
Case 5
ps3="F"
Case 6
ps3="G"
Case 7
ps3="H"
Case 8
ps3="I"
Case 9
ps3="J"
Case 10
ps3="K"
Case 11
ps3="L"
Case 12
ps3="M"
Case 13
ps3="N"
Case 14
ps3="O"
Case 15
ps3="P"
Case 16
ps3="Q"
Case 17
ps3="R"
Case 18
ps3="S"
Case 19
ps3="T"
Case 20
ps3="U"
Case 21
ps3="V"
Case 22
ps3="W"
Case 23
ps3="X"
Case 24
ps3="Y"
Case 25
ps3="Z"
EndSelect
Until h1=ps1 And h2=ps2 And h3=ps3 And h=x
Debug(p)