OK, first, I just want to say that I'm new here, so hello and all that. Anyways, I've been reading "Programing for Dummies" recently, and it got into the section on advanced programing topics. And that particular section was on sorting and searching algorithms. The one I don't understand is the insertion sort algorithm in Liberty Basic. Here it is(Note: There may be a few mistakes because I wrote it from looking at it, it's not the actual code):

1: Why did they make Maxsize equal to 6 if the only used 5? And how did they use the Redim function if Myarray hasn't been declaired yet?2:What does INT (RND (1) *100) +1 do? It never explained it.3:ArrayPos to Count step -1 would repeat twice, wouldn't it? If so, why would it need to?4:How did they use the PRINT function with nothing to print?

RND(1) is a random real number between 0 and 1. If you multiply it by 100 then take the integer, you'll have a random integer from 0 to 99. Adding 1 gives you a random integer from 1 to 100. This is just filling the array with random numbers prior to sorting it.

The first PRINT commands output the values of the unsorted array, then the text "(initial array)".Inside the sort loop, they're printing out the array each time that it is reordered. The looped PRINTs with a semi-colon at the end print the value and a space but they do not include a carriage return and line feed. The PRINT by itself adds the carriage return and line feed at the end of the line.After the sort is complete, they output the values of the sorted array and then the text "(sorted array)".

The way that the insertion sort works is to go through the array looking at each new value and putting it into the correct order in the part of the array that has already been sorted. I know that when I've had to manually sort stacks of records for filing, I've used an insertion sort method. You may want to try this and compare it to a bubble sort, counting the number of comparisons and swaps for each method. Move on to heap sort, quick sort, etc.

I really have to wonder whether BASIC is still a reasonable first language for beginners, now that we've got more modern interpreted languages like Python.

What I'm really curious about is how one FINDS this "Libery" BASIC... is it that common? was it a factor of advertisement? word-of-mouth/recommendation by peers? Or is this some lame blatant attempt at a spammer trying to "advertise" this unknown BS version of basic to make money or paid-to-click crap?

I really have to wonder whether BASIC is still a reasonable first language for beginners, now that we've got more modern interpreted languages like Python.

What I'm really curious about is how one FINDS this "Libery" BASIC... is it that common? was it a factor of advertisement? word-of-mouth/recommendation by peers? Or is this some lame blatant attempt at a spammer trying to "advertise" this unknown BS version of basic to make money or paid-to-click crap?

That's pretty funny given that you were the first person in this thread to post links to their web site...

The years just pass like trains. I wave, but they don't slow down.-- Steven Wilson