Page 1 of 1

Question

Posted: Wed Jun 19, 2013 1:49 pm
by Henko
option base 1 ! option angle degrees
dim tok(40,10,2) ! tokens(tok)
graphics ! draw color 0,0,0
loop1: ! count=3 ! graphics clear .8,.8,.8
loop:
draw_text("hello all, is this forum still alive?","b",.53*count,count/40,20,20*count,10-count/2,tok)
count=count+1 ! pause .3
if count=40 then ! pause 1 ! goto loop1 ! end if
goto loop
end

def draw_text(txt$,col$,siz,alph,x,y,angl,tok(,,))
set_col(col$)
draw alpha alph ! lt=len(txt$) ! fac=siz/4
ca=cos(-angl) ! sa=sin(-angl) ! draw size 1+int(siz/10)
graphics lock
for i=1 to lt
t$=substr$(txt$,i,i) ! t=asc(t$)
if t>96 then ! k=t-82 ! goto dt_loop1 ! end if
if t>47 and t<58 then ! k=t-44 ! goto dt_loop1 ! end if
if t=32 then k=1 ! if t=44 then k=2
if t=46 then k=3 ! if t=63 then k=14
dt_loop1:
r=siz*(i-1) ! xd=x+r*ca ! yd=y+r*sa
for j=1 to 10
xl=fac*tok(k,j,1) ! yl=fac*tok(k,j,2)
if xl<0 then dt_loop2
xp=xd+xl*ca-yl*sa ! yp=yd+xl*sa+yl*ca
if j=1 then draw to xp,yp else draw line to xp,yp
next j
dt_loop2:
next i
graphics unlock
end def

def tokens(tok(,,)) ' dim tok(40,10,2) needed
for i=1 to 40 ! for j=1 to 10 ! for k=1 to 2
read tok(i,j,k)
next k ! next j ! next i
data -1,0, 0,0, 0,0, 0,0, 0,0, 0,0, 0,0, 0,0, 0,0, 0,0 '
data 1.5,3, 2,3, 2,3.5, 1,4, 1.5,3.5, 1.5,3, -1,0,0,0,0,0,0,0 ',
data 1,3.5, 1.5,3.5, 1.5,4, 1,4, -1,0,0,0,0,0,0,0,0,0,0,0 '.
data 0,1, 0,3, 1,4, 2,4, 3,3, 3,1, 2,0, 1,0, 0,1, -1,0 '0
data 1,1, 2,0, 2,4, 1,4, 3,4, -1,0, 0,0, 0,0, 0,0, 0,0 '1
data 0,1, 1,0, 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0, 0,0 'j
data 0,0, 0,4, 0,3, 3,0, 1.5,1.5, 3,4, -1,0, 0,0, 0,0, 0,0 'k
data 0,0, 0,4, 3,4, -1,0, 0,0, 0,0, 0,0, 0,0, 0,0, 0,0 'l
data 0,4, 0,0, 1.5,2, 3,0, 3,4, -1,0, 0,0, 0,0, 0,0, 0,0 'm
data 0,4, 0,0, 3,4, 3,0, -1,0, 0,0, 0,0, 0,0, 0,0, 0,0 'n
data 0,1, 0,3, 1,4, 2,4, 3,3, 3,1, 2,0, 1,0, 0,1, -1,0 'o
data 0,4, 0,0, 2,0, 3,1, 2,2, 0,2, -1,0, 0,0, 0,0, 0,0 'p
data 2,4, 1,4, 0,3, 0,1, 1,0, 2,0, 3,1, 3,3, 2,3, 3,4 'q
data 0,4, 0,0, 2,0, 3,1, 2,2, 0,2, 1,2, 3,4, -1,0, 0,0 'r
data 3,0, 1,0, 0,1, 1,2, 2,2, 3,3, 2,4, 0,4, -1,0, 0,0 's
data 0,0, 3,0, 1.5,0, 1.5,4, -1,0, 0,0, 0,0, 0,0, 0,0, 0,0 't
data 0,0, 0,3, 1,4, 2,4, 3,3, 3,4, 3,0, -1,0, 0,0, 0,0 'u
data 0,0, 1.5,4, 3,0, -1,0, 0,0, 0,0, 0,0, 0,0, 0,0, 0,0 'v
data 0,0, 0,4, 1.5,2, 3,4, 3,0, -1,0, 0,0, 0,0, 0,0, 0,0 'w
data 0,0, 3,4, 1.5,2, 0,4, 3,0, -1,0, 0,0, 0,0, 0,0, 0,0 'x
data 0,0, 1.5,2, 0,4, 3,0, -1,0, 0,0, 0,0, 0,0, 0,0, 0,0 'y
data 0,0, 3,0, 0,4, 3,4, -1,0, 0,0, 0,0, 0,0, 0,0, 0,0 'z
end def

def set_col(col$)
if col$="r" or col$="R" then
draw color 1,0,0 ! fill color 1,0,0
end if
if col$="g" or col$="G" then
draw color 0,.6,0 ! fill color 0,.6,0
end if
if col$="b" or col$="B" then
draw color 0,0,1 ! fill color 0,0,1
end if
if col$="n" or col$="N" then
draw color 0,0,0 ! fill color .8,.8,.8
end if
enddef

Re: Question

Posted: Wed Jun 19, 2013 4:59 pm
by Mr. Kibernetik
WOW!
So much work on this! :shock:

Re: Question

Posted: Wed Jun 26, 2013 11:49 am
by Dutchman
I have a look now and then on this forum.
The app however is still less attractive then Basic!, at least for my applications.
Some examples:
Basic! has a more attractive infrastructure with data-, terminal- and edit-screens.
In Smart-Basic you have to make a backup of your program BEFORE you start editing, because a program start will overwrite the original.
The file-handling of Smart-Basic has to be improved.
'Normal' text-files can not be handled as files of text-lines, but should be read word by word.
There should be a possibillity to read complete lines, also for the INPUT command.
……
Smart-Basic however is superior in speed and gives the possibillity to define user-functions.
There should be more however to attract new users.