Skip to content

Commit 17f2f82

Browse files
committed
Changed deprecated CINT call to INT
1 parent 0b98f46 commit 17f2f82

File tree

3 files changed

+58
-68
lines changed

3 files changed

+58
-68
lines changed

samples/node/1157.bas

+52-51
Original file line numberDiff line numberDiff line change
@@ -1,62 +1,63 @@
1-
2-
31
'Written for Smallbasic
42
'Aug 2013 - S Virjee
5-
centerx = xmax / 2
6-
centery = ymax / 2
7-
iter = 20
8-
zoom = 2.8
9-
p=-.745
10-
q=.113
3+
4+
const centerx = xmax / 2
5+
const centery = ymax / 2
6+
const iter = 20
7+
const zoom = 2.8
8+
const p=-.745
9+
const q=.113
10+
1111
rect xmin,ymin, xmax, ymax color 1 FILLED
1212
oldi=1
1313
pqsq = (p*p + q*q)
14+
1415
L = (sqr(p*p + q*q) - 1/iter)*(sqr(p*p + q*q) - 1/iter)
1516
H = (sqr(p*p + q*q) + 1/iter)*(sqr(p*p + q*q) + 1/iter)
1617

17-
for x = -centerx to centerx
18-
for y = 0 to ymax
19-
c = x/xmax * (1-zoom*1.5)
20-
d = y/ymax * (1-zoom)
21-
ztot = 0
22-
i = 1
23-
z = 1
24-
while i < iter and z< zoom*1.5
25-
real = c*c - d*d + p
26-
imag = 2* c * d + q
27-
c = real/sgn(d-i)
28-
d = imag
29-
z = (c * c + d * d)
30-
if (z < H) then
31-
if (z > L) and (i > 0) then
32-
ztot = ztot + ( 1- (abs((z - pqsq)/z) /(i/(iter))))
33-
oldi=i
34-
'if i<25 and z>0 then i=abs((c*d+q))*i
35-
end if
36-
end if
37-
i = i + 1
38-
wend
39-
if ztot => 0 then i = cint(sqr(ztot) * 256)
40-
if i < 256 then red = i :green=0:blue=0
41-
if i > 255 and i <= 512 then green = i - 256:blue=0:red=255
42-
if i > 511 then green=255:blue=0:red=255
43-
if i > 511 and i <= 768 then blue = i - 512:red=255:green=255
44-
if i > 768 and i<= 1026 then blue = 255:red=255:green=255
45-
if i > 1026 then blue=55:red=255:green=55
46-
gray = int((red+green+blue) * .33)
47-
hot = if(max(red,green,blue)<255,max(red,green,blue),0)
48-
if oldi=1 then red = hot: 'Outer Circle 1 Figure 8
49-
if oldi=2 then green = hot'Outer Circle 2
50-
if oldi=3 then red = hot:blue=gray 'Inner Circle Figure 8 - Yellow
51-
if oldi=4 then blue=hot:green=red:red=gray 'Inner to 2/Outer Circle 4 Loops top
52-
if oldi=>5 then red = int((hot+blue+green)*.33)/(oldi):'This is main color
18+
for x = -centerx to centerx
19+
for y = 0 to ymax
20+
c = x/xmax * (1-zoom*1.5)
21+
d = y/ymax * (1-zoom)
22+
ztot = 0
23+
i = 1
24+
z = 1
25+
while i < iter and z< zoom*1.5
26+
real = c*c - d*d + p
27+
imag = 2* c * d + q
28+
c = real/sgn(d-i)
29+
d = imag
30+
z = (c * c + d * d)
31+
if (z < H) then
32+
if (z > L) and (i > 0) then
33+
ztot = ztot + ( 1- (abs((z - pqsq)/z) /(i/(iter))))
34+
oldi=i
35+
'if i<25 and z>0 then i=abs((c*d+q))*i
36+
end if
37+
end if
38+
i = i + 1
39+
wend
40+
if ztot => 0 then i = int(sqr(ztot) * 256)
41+
if i < 256 then red = i :green=0:blue=0
42+
if i > 255 and i <= 512 then green = i - 256:blue=0:red=255
43+
if i > 511 then green=255:blue=0:red=255
44+
if i > 511 and i <= 768 then blue = i - 512:red=255:green=255
45+
if i > 768 and i<= 1026 then blue = 255:red=255:green=255
46+
if i > 1026 then blue=55:red=255:green=55
47+
gray = int((red+green+blue) * .33)
48+
hot = if(max(red,green,blue)<255,max(red,green,blue),0)
49+
if oldi=1 then red = hot: 'Outer Circle 1 Figure 8
50+
if oldi=2 then green = hot'Outer Circle 2
51+
if oldi=3 then red = hot:blue=gray 'Inner Circle Figure 8 - Yellow
52+
if oldi=4 then blue=hot:green=red:red=gray 'Inner to 2/Outer Circle 4 Loops top
53+
if oldi=>5 then red = int((hot+blue+green)*.33)/(oldi):'This is main color
5354
col = -red+(256*-green)+(256*256* -blue)
54-
'col=rgb(red,green,blue)
55-
pset centerx+x, centery-y color col
56-
pset xmax-centerx-x,centery+y color col
57-
next y
58-
showpage
59-
delay 1
60-
next x
55+
'col=rgb(red,green,blue)
56+
pset centerx+x, centery-y color col
57+
pset xmax-centerx-x,centery+y color col
58+
next y
59+
showpage
60+
delay 1
61+
next x
6162
showpage
6263
pause

samples/node/155.bas

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
21
'Hangman v2.bas SmallBASIC 0.12.0 2015-11-20 MGA/B+ modified from:
32
'''HANGMAN.BAS by Eric Toft
43
''
@@ -13,6 +12,7 @@
1312
window 0,200,200,0 '<============== helps fit any screen
1413
cls
1514
randomize ticks
15+
1616
if HangFile<>"" then
1717
tload Hangfile, fraze
1818
ct = ubound(fraze)
@@ -85,8 +85,8 @@ FUNC COLLECTPEN
8585
adder = 13
8686
yy = 19
8787
FI
88-
ch = 65 + (adder + CINT(xx / 15))
89-
line cint(xx/15)*15,yy,(cint(xx/15)*15)+10,yy
88+
ch = 65 + (adder + INT(xx / 15))
89+
line int(xx/15)*15,yy,(int(xx/15)*15)+10,yy
9090
K$=string(1,ch)
9191
FI
9292
PEN OFF

samples/node/62.bas

+3-14
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,9 @@
1-
21
'''HANGMAN.BAS by Eric Toft
32
''
43
''Hang.dat file - just create a file called hang.dat
54
''Put one Phrase on each line. You can use the program
65
''to add more phrases, or use an external editor.
76
''
8-
''THE BAROSSA VALLEY
9-
''THE ADELAIDE HILLS
10-
''MT REMARKABLE
11-
''MCLEODS DAUGHTERS
12-
''FREELING REDLEGS
137

148
LABEL START:
159
CLS
@@ -49,7 +43,7 @@ END
4943

5044
LABEL aPLAY:
5145
''first-randomly pick a phrase
52-
idx = CINT(UBOUND(FRAZE) * RND)
46+
idx = INT(UBOUND(FRAZE) * RND)
5347
PHRASE$ = FRAZE(idx)
5448
PLAYGAME PHRASE$
5549
PRINT "Pause: return to continue "
@@ -95,8 +89,8 @@ FUNC COLLECTPEN
9589
adder = 13
9690
yy = 19
9791
FI
98-
ch = 65 + (adder + CINT(xx / 15))
99-
line cint(xx/15)*15,yy,(cint(xx/15)*15)+10,yy
92+
ch = 65 + (adder + INT(xx / 15))
93+
line int(xx/15)*15,yy,(int(xx/15)*15)+10,yy
10094
K$=string(1,ch)
10195
FI
10296
PEN OFF
@@ -217,8 +211,3 @@ LABEL hang:
217211
RETURN
218212

219213
LABEL ENDIT:
220-
221-
222-
223-
224-
'

0 commit comments

Comments
 (0)