If you look into retro computers that had built in BASIC programming languages you will find that old magazines with code listings of about a page or two in length that (if they worked) would run as a game on that platform.
Example ZX81 game called BONKERs in
10 REM **BONKERS**SLR/1985****
20 LET S=0
30 PRINT ,,,," ² · õµ õö ²ö ²óô·öó ±² ±² ±² ²² öµ µ ²³ ³ñ²³ô ´÷ ´÷ ´÷ õµõõö õ õõ õò õõ µ òñ òñ òñ ó õµ õµ ÷¶ õµ ¶³ö µõ µõ µõ"
40 PRINT "¸¸¸¸¸¸¸¸¸¸¸¸¸¸¸¸¸¸¸¸¸¸¸¸¸¸¸¸¸¸¸¸ BY: S T E V E N R E I D ** ¸¸¸¸¸¸¸¸¸¸¸¸¸¸¸¸¸¸¸¸¸¸¸¸¸¸¸¸¸¸¸¸"
50 PRINT ,,,,"STOP THE O""S BEFOE THEY BONK YOU**"
60 PRINT ,,,," USE ARROW KEYS FOR MOVEMENT...."
70 PRINT ,,,,"PRESS ENTER TO BEGIN GAME PLAY??"
80 PAUSE 4E4
85 CLS
90 LET X=10
100 LET Y=4
110 LET X1=X
120 LET Y1=Y
130 DIM Z(8)
140 LET Z(1)=4
150 LET Z(2)=10
160 LET Z(3)=4
170 LET Z(4)=21
180 LET Z(5)=17
190 LET Z(6)=10
200 LET Z(7)=17
210 LET Z(8)=21
215 FAST
220 FOR A=0 TO 21
240 PRINT AT A,0;" ";TAB 31;" ";AT 0,A;" ";AT 21,A;" ";AT 1,1;" ";AT 1,30;" ";AT 20,1;" ";AT 20,30;" "
250 NEXT A
260 PRINT AT 19,15;"!!";AT 2,15;"!!";AT 3,5;"!!";TAB 15;"!!";TAB 25;"!!";AT 4,5;"!!";TAB 25;"!!";AT 5,5;"!!";TAB 25;"!!"; AT 6,5;"!!";TAB 25;"!!";AT 9,15;"!!";AT 10,1;"!!";TAB 14;"!!!!";TAB29;"!!";AT 11,1;"!!";TAB 14;"!!!!";TAB 29;"!!"; AT 12,15;"!!";AT 15,5;"!!";TAB 25;"!!";AT 16,5;"!!";TAB 25;"!!";AT 17,5;"!!";TAB 25;"!!";AT 18,5;"!!";TAB 15;"!!";TAB 25;"!!"
270 LET C$="PEEK (PEEK 16398+256*PEEK 16399)"
275 SLOW
280 PRINT AT X,Y;"X";AT X1,Y1;"-" AND (X1<>X OR Y1<>Y)
290 LET X1=X
300 LET Y1=Y
310 LET X=X-(INKEY$="7")+(INKEY$="6")
320 LET Y=Y-(INKEY$="5")+(INKEY$="8")
325 FAST
330 FOR C=1 TO 7 STEP 2
335 IF Z(C)=0 THEN GOTO 400
340 PRINT AT Z(C),Z(C+1);"O"
350 IF RND>.5 THEN LET Z(C)=Z(C)+SGN (X-Z(C))
360 LET Z(C+1)=Z(C+1)+(INT (RND*3-1))
370 PRINT AT Z(C),Z(C+1);
380 IF VAL C$=128 OR VAL C$=22 THEN LET Z(C)=0
390 PRINT "O"
400 NEXT C
405 SLOW
410 PRINT AT X,Y;
420 IF VAL C$<>0 AND VAL C$<>189 THEN GOTO 600
430 LET S=S+1
440 IF Z(1)=0 AND Z(3)=0 AND Z(5)=0 AND Z(7)=0 THEN GOTO 460
450 GOTO 280
460 CLS
465 SLOW
470 PRINT "YOU COMPLETED A LEVEL...BONUS POINTS****",,"SCORE:";
480 LET S=S+400+INT (RND*100+100)
490 PRINT S,,"PRESS ENTER TO CONTINUE ON******"
500 PAUSE 4E4
510 CLS
520 GOTO 90
600 CLS
605 SLOW
610 PRINT ,,,," ² · õµ õö ²ö ²óô·öó ±² ±² ±² ²² öµ µ ²³ ³ñ²³ô ´÷ ´÷ ´÷ õµõõö õ õõ õò õõ µ òñ òñ òñ ó õµ õµ ÷¶ õµ ¶³ö µõ µõ µõ"
620 PRINT "¸¸¸¸¸¸¸¸¸¸¸¸¸¸¸¸¸¸¸¸¸¸¸¸¸¸¸¸¸¸¸¸ BY: S T E V E N R E I D ** ¸¸¸¸¸¸¸¸¸¸¸¸¸¸¸¸¸¸¸¸¸¸¸¸¸¸¸¸¸¸¸¸"
630 PRINT ,,,," ****YOU'VE BEEN BONKED**** "
640 PRINT ,," YOU SCORED "
650 LET S=S+(100 AND Z(1)=0)+(100 AND Z(3)=0)+(100 AND Z(5)=0)+(100 AND Z(7)=0)
660 LET C$=STR$ S
670 FOR F=1 TO LEN C$
680 LET C$(F)=CHR$ (CODE C$(F)+128)
690 NEXT F
700 PRINT AT 13,15;C$;" POINTS**"
710 PRINT ,,,,"PRESS ENTER TO PLAY GAME AGAIN.."
720 PAUSE 4E4
730 IF INKEY$="LPRINT " THEN GOTO 800
740 CLS
750 RUN
800 CLEAR
810 CLS
820 SAVE "BO"
830 RUN
An entire game UI and instructions in 79 lines of code.
In theory a good to great C# Unity Basic API should let you make the same game in less lines of code.
The case for a C# Unity Basic (CUB) API:
Pros:
- Going back to a more minimal functional style of programming with hardly any boiler plate code.
- Reducing the hidden coupling between the Editor Scene and Code.
- Reduced complexity.
- Super fast to develop and work on.
- Extensible and open.
- Easier to learn.
- Could allow super small Unity games.
Cons:
- Yet another API architectural style to add to the Component OOP, DOTS, Visual, Shader styles already used within Unity.
- Translation from CUB to Unity C# could be complex.
- Would CUB code integrate well with standard Unity C# or DOTS.
- Fast and hacky CUB code could take over and make a mess of Unity standards.
What would also be interesting is if a CUB API could give developers easier and faster access to higher level features like DOTS, Networking and Threading.
Do you think a more BASIC game focused API could or should be added to Unity and why/why not?
PS Programming Challenge - Convert the above bonkers* game to Unity in the fewest lines of code you can?
- or any retro basic code listed game you can find.