Some good points for sure!
I totally forgot about Input$(1) and am kicking myself for it.
That's what I know and respect from the amazing Steve
I do disagree on two lines for Next when one will do, specially for 2D array on game board of graphic, just wasting space. I am a not forbidding colons; as you said and I said, makes sense for multiple assignments and I want to include multiple one word statements.
In Reply above, #24, I agree that first line is crap and I confess I was pushing it to get lines from like 65 to the cute 64. I don't think your alternate is much clearer, IMHO.
We could debate all day what maximum amount of characters per line might work best to avoid horizontal scrolling, so ehh to 80 with 100 chars you have a better chance of fitting comments on same line as code. I say a big YEA! to that.
I think how I got from < 100 to 75 was more artfully done. But here's is a good thing I found getting to 64 lines:
Getting rid of 2 lines for Function definition /End Function, which you can do anytime you call a sub or function only once in main code, this was slightly ineffecient:
You could : Exit Function after each of 3 RemainMove = 1 to get back to it in main faster (but who would really notice) but that means more colons crap.
To this:
Which actually did function more efficiently using the old fashioned THEN (GOTO) line_number and no colon crap.
I totally forgot about Input$(1) and am kicking myself for it.
That's what I know and respect from the amazing Steve
I do disagree on two lines for Next when one will do, specially for 2D array on game board of graphic, just wasting space. I am a not forbidding colons; as you said and I said, makes sense for multiple assignments and I want to include multiple one word statements.
In Reply above, #24, I agree that first line is crap and I confess I was pushing it to get lines from like 65 to the cute 64. I don't think your alternate is much clearer, IMHO.
We could debate all day what maximum amount of characters per line might work best to avoid horizontal scrolling, so ehh to 80 with 100 chars you have a better chance of fitting comments on same line as code. I say a big YEA! to that.
I think how I got from < 100 to 75 was more artfully done. But here's is a good thing I found getting to 64 lines:
Getting rid of 2 lines for Function definition /End Function, which you can do anytime you call a sub or function only once in main code, this was slightly ineffecient:
Code: (Select All)
Function RemaingMove ' == Can player still make a move? ==
For y = 0 To 3: For x = 0 To 3 ' == Look for empty space or combine move ==
If B(y * 4 + x) = 0 Then RemaingMove = 1 ' == yes a move is left ==
If y < 3 Then If B(y * 4 + x) = B((y + 1) * 4 + x) Then RemaingMove = 1 ' move left ==
If x < 3 Then If B(y * 4 + x) = B(y * 4 + (x + 1)) Then RemaingMove = 1 ' move left ==
Next: Next
End Function
To this:
Code: (Select All)
For y = 0 To 3: For x = 0 To 3 ' == Look for empty space or combine move ==
If B(y * 4 + x) = 0 Then 10 ' == yes a move is left, skip to 10 ==
If y < 3 Then If B(y * 4 + x) = B((y + 1) * 4 + x) Then 10 ' == a move left goto 10 ==
If x < 3 Then If B(y * 4 + x) = B(y * 4 + (x + 1)) Then 10 ' == a move left goto 10 ==
Next: Next
b = b + ...