Posts: 594
Threads: 11
Joined: Oct 2002
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
Posts: 3,343
Threads: 83
Joined: Mar 2003
I've got a 3 line function that does that in the WIKI, I may just change it if one line will do.
Posts: 1,956
Threads: 65
Joined: Jun 2003
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
*****
Posts: 729
Threads: 105
Joined: Feb 2003
whitetiger, just so you know: Both the NAND and NOR functions will always produce the same result.
So "X NAND Y = X NOR Y".
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]
Posts: 2,765
Threads: 138
Joined: Nov 2002
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.
Back by popular demand!
I will byte and nibble you bit by bit until nothing remains but crumbs.
Posts: 1,956
Threads: 65
Joined: Jun 2003
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".
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.
*****
Posts: 33
Threads: 3
Joined: Oct 2003
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
Posts: 3,343
Threads: 83
Joined: Mar 2003
You should get it to print only when someone presses a key
Posts: 1,813
Threads: 284
Joined: Mar 2003
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.
Posts: 309
Threads: 15
Joined: Jul 2003
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)