scene.org File Archive

File download

<root>­/­parties­/­2022­/­vccc22­/­christmas_star_challenge/neotenien_thomson_basic_2022_xmas-star.zip

File size:
33 027 bytes (32.25K)
File date:
2022-12-30 11:32:13
Download count:
all-time: 8

Preview

  • 2022_Xmas-Star/ dir
  • 2022_Xmas-Star/BASIC_Xmas-Star_Thomson-short.txt 628B
  • 2022_Xmas-Star/BASIC_Xmas-Star_Thomson.txt 810B
  • 2022_Xmas-Star/README.TXT 1.03K
  • 2022_Xmas-Star/Screenshot_20221219_074804.png 10.92K
  • 2022_Xmas-Star/Screenshot_20221219_081856.png 21.17K
  • 2022_Xmas-Star/Star_Xmas_Basic_Thomson.fd 320.00K

file_id.diz

1 cx=8:cy=8:IMAX=100:DIM px(IMAX),py(IMAX),psens(IMAX):cls:r(0)=4.25:r(1)=9.2:r(2)=6.3:r(3)=9.2:o=3.14159/8
2 fori=1to16:line (cx+int(r((i-1)MOD4)*sin((i-1)*o)+0.5),cy+int(r((i-1)MOD4)*cos((i-1)*o)+0.5))-(cx+int(r(i MOD4)*sin(i*o)+0.5),cy+int(r(i MOD4)*cos(i*o)+0.5))"*":next
3 dx(0)=0:dy(0)=-1:dx(1)=1:dy(1)=0:dx(2)=0:dy(2)=1:dx(3)=-1:dy(3)=0:psens(1)=0:sens=0:x=cx:y=cy:px(1)=x:py(1)=y:ip=1:locate x,y:?"*"
4 x=px(ip):y=py(ip):sens=psens(ip):ifsens=4then7
5 x=x+dx(sens):y=y+dy(sens):ifscreen(x,y)<>42thenip=ip+1:px(ip)=x:py(ip)=y:psens(ip)=0:locate x,y:?"*":goto4
6 sens=sens+1:psens(ip)=sens:goto4
7 ifip>1thenip=ip-1:goto4
5 CLS:?"Typein center coordonate (x,y) of star (8-31),(8-16)":input cx,cy:if cx<8 or cx>31 or cy<8 or cy>16 then 5
10 IMAX=100:DIM px(IMAX),py(IMAX),psens(IMAX):cls:r(0)=4.25:r(1)=9.2:r(2)=6.3:r(3)=9.2:o=3.14159/8
20 for i=1 to 16:line (cx+int(r((i-1)MOD 4)*sin((i-1)*o)+0.5) , cy+int(r((i-1) MOD 4)*cos((i-1)*o)+0.5))-(cx+int(r(i MOD 4)*sin(i*o)+0.5) , cy+int(r(i MOD 4)*cos(i*o)+0.5))"*":next
30 'Remplissage : Utilisation de pile
31 dx(0)=0:dy(0)=-1:dx(1)=1:dy(1)=0:dx(2)=0:dy(2)=1:dx(3)=-1:dy(3)=0:psens(1)=0:sens=0:x=cx:y=cy:px(1)=x:py(1)=y:ip=1:locate x,y:?"*"
32 x=px(ip):y=py(ip):sens=psens(ip):if sens=4 then 37
33 x=x+dx(sens):y=y+dy(sens):if screen(x,y)<>42 then ip=ip+1 : px(ip)=x : py(ip)=y : psens(ip)=0:locate x,y:?"*": goto32
34 sens=sens+1:psens(ip)=sens:goto32
37 if ip>1 then ip=ip-1:goto32
This Basic 1.0 for the Star challenge was tested and run on Thomson TO8 computer emulator (DC MOTO), choosing Basic 1.0 ("2" in main screen) or Basic 512 (1 in main menu). 

To launch the fd file : choose the TO8/TO9/TO9+ emulation, load the fd file, on DCMoto or other Thomson emulator, then choose B on main screen (For TO8) or D (on TO9/TO9+). The program ask you where to put center of star and check if your answer is acceptable.

It works faster on Basic 512 that on Basic 1.0 (+30% faster).

This BASIC code is personnal code I built for this challenge. It is fully Basic 1.0 compatible so that it can work on all 8 bits computer which has a full compatible Basic 1.0 (On MSX, Amstrad maybe, C64 etc). It use a personnal code for fulling close shape.

We can reduice the Line parts (line 20) on basic code (omitting the origin point) but there were a problem on DC Moto emulator about this point. And finally the code is not shorter because we should add "POINT" instruction at the begining in this case.

Bruno AUBIN/Neotenien : 2022-12-19 Monday