Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Shortest useful program
#31
Quote:
ak00ma Wrote:... Here's a better round function... ( I only changed one thing )
Code:
DEF FNround# (m#, dec%) = SGN(m#) * INT(10^dec% * ABS(m#) + .5) / 10 ^ dec%
AK00MA:
Excellent, although you didn't declare what feature you added. I assume from the code that dec% declares the number of IMPLIED decimals contained in the number in m#. If this is the case, then you enhanced Oracle's general purpose function with this added feature.
*****

Oh...sorry..I forgot it. Yeah, you're right..
B 4 EVER
Reply
#32
I've got a 3 line function that does that in the WIKI, I may just change it if one line will do.
Reply
#33
Here's a little function of common usage:
Code:
' ============================ FILLSTRING =================================
' Converts value (V#) to string of specified length (L) with leading zeros.
' =========================================================================
FUNCTION FillString$ (V#,L) STATIC
   FILLSTRING$=right$(STRING$(L,"0")+LTRIM$(STR$(V#)),L)
END FUNCTION
*****
Reply
#34
whitetiger, just so you know: Both the NAND and NOR functions will always produce the same result.

So "X NAND Y = X NOR Y". Smile
size=9]"To announce that there must be no criticism of the president, or that we are to stand by the president, right or wrong, is not only unpatriotic and servile, but is morally treasonable to the American public." -- Theodore Roosevelt[/size]
Reply
#35
Truth tables

NAND
0 0 1
0 1 1
1 0 1
1 1 0

NOR
0 0 1
0 1 0
1 0 0
1 1 0

umm.
[Image: sig.php]
Back by popular demand!
I will byte and nibble you bit by bit until nothing remains but crumbs.
Reply
#36
Quote:whitetiger, just so you know: Both the NAND and NOR functions will always produce the same result.

So "X NAND Y = X NOR Y". Smile

Sorry, Progger, that's not true. If it were, why would they bother having both operators?

A NAND is the same as an AND, but reversing the bits (NOT) on the output.

A NOR is the same as an OR, but reversing the bits (NOT) on the output.

Since AND and OR are different, then NAND and NOR are different.
*****
Reply
#37
heres a 5 line arcade style game.

Code:
DO
a=a+1
IF a>10 THEN a=0
PRINT "Final hardcore scores of yours = "; a
LOOP UNTIL INKEY$ <> ""

To make it more fun, play it with friends, and the one with the lowest score loses a finger. Trust me, very exciting. Or you could just implement a dare system.
You can't get a job in the games industry, until you've had at least 2 years experience in the industry, which wont happen until you get a job in the industry. " - random recruitment agency
Reply
#38
You should get it to print only when someone presses a key Smile
Reply
#39
Here you go:

Code:
INPUT "Pick a number between 1 and 65,535: ", port&
OUT port&, INT(RND * 256)
PRINT "Port "; port&; " successfully f*cked up."
earn.
Reply
#40
Seph,
the title of this thread is the shortest useful program. The annoying programs were another thread.
hrist Jesus came into the world to save sinners, of whom I am first.(I Timothy 1:15)

For God so loved the world, that He gave His only begotten Son,
that whoever believes in Him should not perish, but have eternal life.(John 3:16)
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)