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.
[Implemented] Random
-
- Enthusiast
- Posts: 362
- Joined: Wed Aug 06, 2003 2:49 pm
- Location: Venice - Italy, Japan when possible.
- Contact:
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?
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?
Blade
Where can we buy this language?
EDIT: I just tried it...
It says "69"! Fred!!! 

Where can we buy this language?
EDIT: I just tried it...
Code: Select all
number.l = PrintFredsPreferredNumber ()
Debug number

Good programmers don't comment their code. It was hard to write, should be hard to read.
-
- Enthusiast
- Posts: 423
- Joined: Fri Apr 25, 2003 5:22 pm
- Contact:
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
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
%1>>1+1*1/1-1!1|1&1<<$1=1
-
- Enthusiast
- Posts: 362
- Joined: Wed Aug 06, 2003 2:49 pm
- Location: Venice - Italy, Japan when possible.
- Contact:
Great! Better than my "Print" example!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)

...
ehmm...
perhaps you were serious about that?

-
- Enthusiast
- Posts: 423
- Joined: Fri Apr 25, 2003 5:22 pm
- Contact: