OK so I'm in the process of converting WETSPOT.BAS to C+SDL. The original code is in pretty straightforward QBASIC which should, in theory, make it very easy. However, it is worthy of note that the original code is also exceptionally sloppy and makes a large number of rookie mistakes. Take this fragment of code for example:
Code: Select all
xA(0) = 0: yA(0) = 0
xA(1) = 0: yA(1) = 1
xA(2) = 1: yA(2) = 0
xA(3) = 0: yA(3) = -1
xA(4) = -1: yA(4) = 0
RESTORE
FOR i = 1 TO 4: READ xA(i), yA(i): NEXT i
FOR i = 1 TO 8: READ Value(i): NEXT i
DATA 0,1,1,0,0,-1,-1,0,100,150,200,250,200,350,300,400,20,20
Can someone please explain to me why someone would set values in an array and then read them from data directly afterward? This is illogical and baffles me. What's even more baffling is the two extra numbers of data at the end...there are no additional READ statements in the entire source code.
There are other such rookie issues in the source code as well, but as this code is well over a decade old, I guess everyone was a newbie once.

Still, this is a shining example of why standards and required declaration of variables are a must when coding.
The program does not run in the latest QB64 due to the usage of TIMER OFF found at line 745.