home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Ahoy 1985 October
/
Ahoy_Magazine_85-10_1985_Double_L.d64
/
cd22-1
(
.txt
)
< prev
next >
Wrap
Commodore BASIC
|
2022-10-26
|
483b
|
17 lines
0 rem << cd22-1 >>
1 rem
2 rem various readers' solutions to
3 rem problem #18-1 : cycling function
4 rem
10 def fnc(d)=d*sgn((99-x)/(x-1))
11 def fnc(d)=int(x/100)*-105+5
12 def fnc(d)=d+10*(x=100)-10*(x=0)
13 def fnc(d)=d+10*(x>95)-10*(x<5)
14 def fnc(d)=d+(2*d*(x=0 or x=100))
15 def fnc(d)=5+10*(x>95 or d<5)-10*(x<5)
16 def fnc(d)=d+(2*d*((x<=0)or(x>=100)))
17 def fnc(d)=-5*(d=5)+5*(d=-5)+10*(x=100)-10*(x=0)
18 def fnc(d)=d*((((x=100)+(x=0))*2)+1)
20 d=5:x=0
30 s=x/5:printspc(abs(s))x:x=x+d:d=fnc(d):goto30