Page 2 of 2
Posted: Sat May 21, 2005 10:40 am
by Polo
Yeah, but Basic language is there for what then ? Not do make our program in one line, but it is there to minimize the number of lines... And if we have to rewrite commands like Random...
I don't know for the other language, but a minimize parameter is not what i would say useless.
Posted: Sat May 21, 2005 11:54 am
by Blade
I don't want PB to became a language with 10000 commands, where 80% are variations of other commands...
that way you have to check always the manual for the right one, when a "well constructed" command can do all:
Print (a$)
PrinN (a$)
PrintWithTabs (a$)
PrintWithAnsiOn (a$)
PrintWithAnsiOff (a$)
PrintWithUnicodeOn (a$)
PrintWithUnicodeOff (a$)
PrintFirstTenLetters (a$)
PrintLastTenLetters (a$)
PrintUppercase (a$)
PrintLowercase (a$)
PrintStipSlashes (a$)
PrintNumbersAsArabic (a$)
PrintNumbersAsRoman (a$)
PrintMyName ()
PrintFredsPreferredNumber ()
Do you want this?
Can you really call this Basic?
Posted: Sat May 21, 2005 11:58 am
by traumatic
Blade
Where can we buy this language?
EDIT: I just tried it...
Code: Select all
number.l = PrintFredsPreferredNumber ()
Debug number
It says "69"! Fred!!!

Posted: Sat May 21, 2005 1:29 pm
by Froggerprogger
Errr. I would extend the Random-command to the following:
Random(max) - returns an integer value from [0..max]
Random(min, max) - returns an integer value from [min..max]
RandomF(max, param) - returns a float value from 0..max
RandomF(min, max, param) - returns a float value from min..max
By default (param = 0) the intervall is closed, so it is [0..max] or [min..max]
For RandomF the param does:
#RandomF_LeftOpen => [a,b] -> ]a,b]
#RandomF_RightOpen => [a,b] -> [a,b[
#RandomF_Open = #RandomF_LeftOpen | #RandomF_RightOpen => ]a,b[
Further another optional parameter would be useful:
Random(min, max, *list) where *list is a linked list that contains values that should NOT be returned by Random, though they lay in range [min,max]. Further a parameter for that ONLY values from that list should be returned.
The same functionality should be done with RandomF in all variations.
Further it would be nice to extend this to Arrays, of course, and to combinations of Arrays and Lists, where from one of them the values should be NOT returned, from the other they should.
Of course we could extend this e.g., so that all entries with odd numbers in the overgiven arrays should NOT be returned, and so on.
Some more flags could control the behaviour of ....
[at this place I would like to fade-out my talking smoothly, so that these word disappears slightly...]
But anyway, of course there are endless possibilities, but I would like a command such as:
Random(max)
Random(min, max)
where min and max could become negative values.
RandomF() would be cool, too.
No need for them, but nice.
Just my 42 cents
Posted: Sat May 21, 2005 2:49 pm
by Fred
RandomF() makes sens.
Posted: Sat May 21, 2005 3:19 pm
by Blade
Froggerprogger wrote:
Random(max) - returns an integer value from [0..max]
Random(min, max) - returns an integer value from [min..max]
RandomF(max, param) - returns a float value from 0..max
RandomF(min, max, param) - returns a float value from min..max
By default (param = 0) the intervall is closed, so it is [0..max] or [min..max]
For RandomF the param does:
#RandomF_LeftOpen => [a,b] -> ]a,b]
#RandomF_RightOpen => [a,b] -> [a,b[
#RandomF_Open = #RandomF_LeftOpen | #RandomF_RightOpen => ]a,b[
Random(min, max, *list)
Great! Better than my "Print" example!
...
ehmm...
perhaps you were serious about that?

Posted: Sat May 21, 2005 4:27 pm
by Froggerprogger
Blade wrote:...
ehmm...
perhaps you were serious about that?

Of course!
