The following program inputs two numbers, multiplies them, and outputs the answer.
Multiplication is repeated addition. The program is no more efficient than counting on your fingers, but it's automated. There is also a brilliant ZZT engine that simulates it and lets you see exactly what the program is doing. (This doubles as a proof-by-simulation that ZZT is turing complete).
Here's my multiplication program, mid-way between multiplying 2 by 3 (I use small numbers because of how long the program takes to run when I slow it down to a speed I can watch!).
Other weird programming languages I have recently read about include LOLCODE ( a work in progress, not finished yet) that goes something like this:
HAI
CAN HAS STDIO?
VISIBLE "HAI WURLD"
KTHXBAI
This would be so much fun to program in.
No comments:
Post a Comment