64-bit BCPL Cintcode System (1 Nov 2006)
Version of implementation BCPL Cintcode System of programming language BCPL64-bit version of BCPL Cincode System. The author claims it’s still under development, but there haven’t been any new releases over last 5 years.
Examples:
Hello, World! - BCPL (331):
$( ... $)
is another form of delimiting a block. *n
prints a newline.
GET "libhdr"
LET start() = VALOF
$( writes("Hello, World!*n")
RESULTIS 0
$)
Factorial - BCPL (332):
This example uses recursive factorial definition. Calculating 15! and larger results in math overflow, thus the result ends like this:
12! = 479001600
13! = 6227020800
14! = 87178291200
15! = 18000
16! = 000
GET "libhdr"
LET start() = VALOF
{ FOR i = 0 TO 16 DO writef("%n! = %n*n", i, factorial(i))
RESULTIS 0
}
AND factorial(n) = n=0 -> 1, n*factorial(n-1)
Fibonacci numbers - BCPL (333):
This example uses recursive definition of Fibonacci numbers.
GET "libhdr"
LET start() = VALOF
{ FOR i = 0 TO 15 DO writef("%n, ", fibonacci(i))
writef("...*n")
RESULTIS 0
}
AND fibonacci(n) = n<2 -> 1, fibonacci(n-1)+fibonacci(n-2)
Comments
]]>blog comments powered by Disqus
]]>