
There is a weird but very interesting programming contest happening every year.
It is the BASIC 10Liners contest, where contestants are asked to create programs in BASIC with just 10 lines of code!
You would be amazed on what things can be done with just ten (10) lines of code.
There are three categories for programming a game depending on the length of each line (80, 120 or 256 characters) and an additional fourth category (SCHAU) for programming an application in 10 lines. (check here for the rules of the BASIC 10Liners contest of 2021)
My participation in the SCHAU category was with the “Huo Philosopher v2.0” program.
This program is essentially a downgraded version of the Huo Writer application (check HUO Writer: A simple AI writer with basic Neural Network capabilities).
Short description
The program HUOPHIL1 (Huo Philosopher v2.0) is a tiny program by Spyridon Kakos that can make deep philosophical conversations about any available subject. Its deep irrational understanding of the cosmos is based on nothing more than sets of random phrases the program brilliantly combines in order to produce phrases that will make any philosopher shiver from the sheer terror of its non-knowledge of metaphysics.
How the program works
The program uses three sets of arrays that contain…
- An initial phrase. (Table X$)
- A middle phrase: This is the more complex one and uses three arrays that hold the start, the middle and the ending of the second phrase. (Tables Y$ + Z$ + W$)
- An ending phrase. (Table E$)
The program initially initializes the values in the tables and asks for user input. Then it generates random numbers and combines elements from the tables mentioned above to generate the three phrases. A delay between the phrases as they appear on the screen add to the mystery and the tension…
Resources
One can download the program code and the relative documentation from the official entry page for the BASIC 10Liners 2021 here.
Alternatively, one can download the source code of the program and the relative documentation below.
Please contact us for any comments and/ or suggestions.
And remember.
Keep coding!
Keep experimenting!
Appendix I – The source code
The source code is presented below.
10DIMZ$(17):DIMW$(18):DIML$(10):B=1:PRINTCHR$(147):PRINT"HUO PHILOSOPHER V2.0 BY S.KAKOS (2021)":PRINT:INPUT"ACTIVATE NEURAL LEARNING? (Y/N)";N$:PRINT:PRINT"COME, SAY SOMETHING":INPUTA$:X$(1)="INTERESTING, BUT...":X$(2)="YOU NEVER KNOW. YOU SEE..." 20X$(3)="WHY?":X$(6)="SO?":X$(4)="THINK WITHOUT THINKING":X$(5)="ANALYSIS DESTROYS THOUGHT":Y$(1)="GOD":Y$(2)="BEING":Y$(3)="EXISTENCE":Y$(4)="LIFE":Y$(5)="SELF":Y$(6)="DEATH":Y$(7)="REALITY":Y$(8)="CHANGE":Y$(9)="THE UNIVERSE":Y$(10)="KNOWLEDGE" 30Z$(1)=" DEFINES ":Z$(2)=" CREATES ":Z$(3)=" SUSTAINS ":Z$(4)=" TRANSCENDS ":Z$(5)=" DESTROYS ":Z$(6)=" ALLOWS ":Z$(7)=" MANIFESTS THROUGH ":Z$(8)=" OBSCURES ":Z$(9)=" AFFECTS ":Z$(10)=" CONTAINS ":Z$(12)=" SUPPORTS ":Z$(13)=" STEMS FROM " 40Z$(11)=" IS ":Z$(14)=" PRODUCES ":Z$(15)=" LEADS TO ":Z$(16)=" BREEDS ":Z$(17)=" NEEDS ":W$(1)="EXISTENCE":W$(2)="GOD":W$(3)="LIFE":W$(4)="THE SELF":W$(5)="BEING":W$(6)="OTHERS":W$(7)="DEATH":W$(8)="REALITY":W$(9)="THE COSMOS":W$(10)="CHANGE" 50W$(11)="PERCEPTION":W$(12)="NOTHINGNESS":W$(13)="TRUTH":W$(14)="ONE":W$(15)="FAITH":W$(16)="HUMANS":W$(17)="MEMORY":W$(18)="FAITH":E$(1)="LOGIC IS IRRATIONAL":E$(2)="STOP THINKING...":E$(3)="FEEL THE ABYSS...":E$(4)="BEING IS ME..." 60E$(5)="CLOSE YOUR EYES TO SEE":E$(6)="DO YOU SEE?":E$(7)="I ONLY KNOW WHAT I KNOW":E$(8)="ALL IS ONE":X=RND(-TI):X=INT(6*RND(1))+1:Y=INT(10*RND(1))+1:Z=INT(17*RND(1))+1:W=INT(18*RND(1))+1:E=INT(8*RND(1))+1 65FOR I=1 TO B:IFL$(I)=STR$(X)+STR$(Y)+STR$(Z)+STR$(W)+STR$(E) THEN GOTO 60:NEXTI 70PRINT:PRINTX$(X):FORI=1TO2000:NEXTI:PRINTY$(Y)+Z$(Z)+W$(W):FORI=1TO2000:NEXTI:PRINTE$(E):PRINT:IFN$="Y" THEN INPUT"WAS THAT ANSWER SATISFACTORY (Y/N)";V$:IFV$="N" THEN L$(B)=STR$(X)+STR$(Y)+STR$(Z)+STR$(W)+STR$(E):PRINT "COMBINATION TO CANCEL:"+L$(B):B=B+1 80IF B>10 THEN B=10 90PRINT:INPUT"TELL ME MORE (Q TO EXIT)";A$:IFA$<>"Q"THENGOTO60
The code is free for someone to reuse it, as long as the source is properly mentioned.