Search found 572 matches
- May 02, 2020 9:42
- Forum: General
- Topic: Remove duplicates (Only numbers)
- Replies: 0
- Views: 689
Remove duplicates (Only numbers)
'Experiment # 1: Remove duplicates 'In this experiment, we only use an array 'ONLY NUMBERS!!! DECLARE SUB remove_duplicates(d() AS STRING) DIM AS INTEGER n,x RANDOMIZE ,3 x = 999 DIM d(x+1) AS STRING FOR n = 1 TO x+1 d(n) = LTRIM(STR(INT(RND*2000))) 'print d(n);" "; 'show numbers NEXT n PR...
- Mar 27, 2020 6:18
- Forum: General
- Topic: Ask about "new" and "delete"
- Replies: 5
- Views: 459
Re: Ask about "new" and "delete"
Hi, all:
Ok, thanks everyone!
Cheers
Ok, thanks everyone!
Cheers
- Mar 26, 2020 22:27
- Forum: General
- Topic: Ask about "new" and "delete"
- Replies: 5
- Views: 459
Re: Ask about "new" and "delete"
Hi, paul doe:
ok, thanks for your explanation
it is my mistake of interpretation.
Cheers
ok, thanks for your explanation
it is my mistake of interpretation.
Cheers
- Mar 26, 2020 21:50
- Forum: General
- Topic: Ask about "new" and "delete"
- Replies: 5
- Views: 459
Ask about "new" and "delete"
Hi, all: My question is about "delete". According to the manual, "delete" deletes the portion of memory created by "new". According to my example, there are values that are not removed, they are still in memory. The operation of "delete" is correct? CLS 'We as...
- Mar 21, 2020 10:06
- Forum: General
- Topic: Program to calculate the GCD of more than two numbers
- Replies: 6
- Views: 651
Re: Program to calculate the GCD of more than two numbers
Hi, all: DANGER !!! MY PROGRAM HAS AN ERROR !!! The variable: "e = 0" <<<< ERROR !!! It should say: "e = 1" <<< OK! Example error: How many numbers = 5 Numbers: 8888888 - 444444 - 22222 - 4422 - 88 Show: "1" <<< ERROR !!! It should show: "2" <<< Ok! This is th...
- Mar 21, 2020 8:08
- Forum: General
- Topic: Program to calculate the GCD of more than two numbers
- Replies: 6
- Views: 651
Re: Program to calculate the GCD of more than two numbers
Hi, all: It had been a while since I programmed and yesterday a child asked me how to solve a GCD with more than 2 numbers. I got inspiration from that little program, I did it and it worked. Search Rosetta Code and the Freebasic forum to see if there was something similar and I couldn't find it. I ...
- Mar 20, 2020 16:30
- Forum: General
- Topic: Program to calculate the GCD of more than two numbers
- Replies: 6
- Views: 651
Program to calculate the GCD of more than two numbers
'Program to find only the greatest common divisor of more than two numbers (Only for relatively small numbers) 'Examples: '3567-370968 = 3567 '720-2600 = 40 '4680-7200-16200 = 360 'Program to find only the greatest common divisor DIM AS INTEGER a,b,c,d,e,f,g,k,l CLS INPUT "How many numbers? (2,...
- Jul 22, 2019 5:35
- Forum: General
- Topic: Remove elements repeted
- Replies: 26
- Views: 8464
Re: Remove elements repeted
Hi, fxm:
As always, thank you for your observations.
Apologies
As always, thank you for your observations.
Apologies
- Jul 22, 2019 5:23
- Forum: General
- Topic: Remove elements repeted
- Replies: 26
- Views: 8464
Re: Remove elements repeted
'lrcvs 2019.jul.21 'program to eliminate repeated elements in an array. '1) we sort the initial array, using quicksort. '2) we remove the repeated elements, skipping the ones that are the same 'and reducing the time of "cleaning the repeated elements". '3)It is a small improvement of the ...
- Nov 25, 2017 20:37
- Forum: General
- Topic: QuickSort Text
- Replies: 3
- Views: 527
Re: QuickSort Text
Deleted, it does not work well.
Apologies.
Apologies.
- Nov 25, 2017 8:53
- Forum: General
- Topic: QuickSort Text
- Replies: 3
- Views: 527
QuickSort Text
Deleted, it does not work well.
Apologies.
Apologies.
- Nov 06, 2017 5:33
- Forum: General
- Topic: Remove elements repeted
- Replies: 26
- Views: 8464
Re: Remove elements repeted
Hi: Part # 2: With the previous program, we obtain the unique elements of a list / array (or remove the repeated ones.) Now, we show the original list / array, without the repeated elements and in the initial order. 'lrcvs 01.10.17 'program to eliminate repeated elements in an array. '1) we sort the...
- Nov 05, 2017 12:19
- Forum: General
- Topic: Remove elements repeted
- Replies: 26
- Views: 8464
Re: Remove elements repeted
Hi, fxm: Thank you very much for your observation. I modify the program with your indications. 'lrcvs 01.10.17 'Program to eliminate repeated elements in an array. '1) we sort the initial array, using quicksort. '2) we remove the repeated elements, skipping the ones that are the same 'and reducing t...
- Nov 05, 2017 5:00
- Forum: General
- Topic: Remove elements repeted
- Replies: 26
- Views: 8464
Re: Remove elements repeted
Hi My apologies, now is perfect. 'lrcvs 01.10.17 'Program to eliminate repeated elements in an array. '1) we sort the initial array, using quicksort. '2) we remove the repeated elements, skipping the ones that are the same 'and reducing the time of "cleaning the repeated elements". DECLARE...
- Nov 04, 2017 6:05
- Forum: General
- Topic: Remove elements repeted
- Replies: 26
- Views: 8464
Re: Remove elements repeted
Hi I have modidied the entry of values in the array to "0" 'lrcvs 01.10.17 'Program to eliminate repeated elements in an array. '1) we sort the initial array, using quicksort. '2) we remove the repeated elements, skipping the ones that are the same 'and reducing the time of "cleaning ...