Last Lesson: Learn to Code...

Investigate a few computing systems, starting with BASIC then moving onto Python. Illustrate: program layout including Data Structures & Algorithms

paul martin
2 min readMay 21, 2023

QuiteBASIC

Approach programming first via Computational Thinking where problems are decomposed and simplified into smaller steps, an algorithm is then developed with an eye on possible supported commands, which are varied for different computer languages.

Plot Square numbers (1,4,9,16,25 …) eg 3x3

Simplification: to get a 3x3 use the (pseudo) command PLOT (X,Y) =

PLOT(1,1) PLOT(2,1)PLOT(3,1)

PLOT(1,2) PLOT(2,2)PLOT(3,2)

PLOT(1,3) PLOT(2,3)PLOT(3,3)

Algorithm Use LOOP to repeat line of blobs, for a particular Y

FOR X = 1 TO 3 PLOT (X, Y)

Then precede this loop with one for Y to duplicate vertically

FOR Y= 1 TO 3

A BASIC program thus is

10 LET N= 3
20 PRINT N*N; “ “
30 FOR Y= 1 to N
32 FOR X= 1 to N
40 PLOT X,Y
50 NEXT X
52 NEXT Y

Now inc “data structure”, so can generalise; q-BASIC only a 1D array type:

10 ARRAY A
15 LET N=6
16 FOR X = 1 to N
20 LET A[X]=X
21 NEXT X

30 FOR Y= 1 to N
32 FOR X= 1 to N
40 PLOT A[X],Y
50 NEXT X
52 NEXT Y

Also other examples in qBASIC

PYTHON

https://medium.com/@paulmartin42/learn-python-869b24692f5f

ADVICE SUMMARY

Learn Python - it is ideal time —

— Choose an appropriate Beginner Course

— Build a real Project

— Code for 30+ mins a day

GET an interest you can computerise — something for your CV

GOOD LUCK

OTHER:

GITHUB

You can run VSCode inside Github

--

--