hundreds of years ago I was a programmer. now i’m a dunce. would like to come to grips with python.
I have this bit of psuedocode or this algorithm that I can’t express in Python. That’s a good indication of where I’m at. Can you help?
It is meant to look at a ordered in increasing value list of numbers (which are byte location offset numbers) and if any two adjoining numbers are within 100 of each other print them out consecutively: i.e. no space between. But when we find two that are more than 100 apart then print out a blank row.
so we are supposed to finish up with ‘chunks’ of numbers that are all within 100 of each other.
I think of it like this:
get number1
get number 2
loop 1
if n2 -n1 < 100 write n1,n2
n1 = n2
else
goto loop 1
loop 2
get n3
if n3 - n2 < 100 write n3
n1 = n3)
goto loop 2
else
write blank line
goto loop 1
sorry about the goto’s. you know what i mean i guess. i can’t implement it so’s it works.
don’t know enough python as yet. very early days. started yesterday actually, getting kinda serious about it.