03-28-2006, 12:55 AM
Quote:'
coloums% = 6: rows% = 42:odds& = 1:FOR x = 1 TO coloums: odds& = odds& * ((rows + 1) - x) / x:NEXT:CLS : PRINT odds&
This is an algorithm for finding the odds of a lottery wheel.
That looks like a cool algorithm, EXCEPT it is not on only one line of code, as per the original rules for this thread, which stated:
4) Multiple statements on one line; like:
x=x+1 : x=x and 15
are not considered as one line of code.
The idea of one line algorithms is that they're simple, most people can immediately understand them, they serve as an example for similar simple logic, and people can later use them in their programs when needed.
*****