<Name of Release>

Author: Raul GUiu
Category: Christmas Challenge or Wild
System:   web MSX Emulator (https://webmsx.org)
Language: MSX Basic 3.0
Len source code: 73
Len exe file:    73
Len code only:   73
Instructions:
In https://webmsx.org:
To avoid having to type in the emulator use ALT-B and prompts a text box where the code cab be pasted.

1.Paste the code, ie, the following line:
1FORK=1TO55:J=K\4:D=9-J:LOCATE9+(KAND1)*D,J+D*(KAND2):?STRING$(J,42):NEXT

2. click OK
3. type CLS:RUN (it will work without CLS but it helps to have a clean screen)

Description:

It prints 4 triangles of height 13 by width 13. Each triangle will represent two of the arms of the star.
Initially I used three nexted loops, 1 to 13, 0 to 1 and 0 to 1, to representent the size of the triangle and the x and y directions in which they were printed. I finally used only one loop.

I use locate to position the cursor for each line that I need to print.

The formula to calculate X was that could be 9 or 18-S (S is the line of the triangle form 1 to 13). Y is S to start and 18-S. I used K and 1, to give me altertanives ones and zeros, and for Y used K and 2 what will give me a sequence 0,0,2,2,0,0...The fact that is 2 in Y helped me to remove a 2. To print the lines itself I use STRING$ that allows me to print as many asterisks as required.


Comments:

I havent written any code in Basic for over 30 years. I got a C64 when I was 14 and I was able to learn to program, although I had to save my work in tapes and never build big programs. This challenge will drive me to try to try to write code in basic again, I did enjoyed it, although the lack of knowledge about the tools did made me suffer a bit. I will need to get first a proper environment to write 8 bits basic. For this I used an online emulator.
I included a star.bas file that is basically the txt with different extension. That probably is wrong, I executed the code directly in only consoles and I wasnt able to download the correct .bas.