xcoder
Member in Training
Posts: 52
|
Post by xcoder on Aug 25, 2023 5:35:55 GMT
print "##############"
base = 2 exp = 64 print exponent(base,exp) print:print print "End of Script" End
function exponent(base,exp) x = 1 for i = 1 to exp x = x * base 'the value of x is looped and raised by one power again print x next i print "" exponent = x end function insert code here
|
|
|
Post by plus on Aug 25, 2023 12:52:26 GMT
Your test is almost perfect! Single spaced under code tabs. You just need to paste code over the "insert code here" words so they are erased when you paste your stuff in there. I add a little mod: ' 2023-08-25 b+ mod xcoder by adding commas base = 2 exp = 64 print right$(space$(30);addcomma$(exponent(base,exp)), 30) print:print print "End of Script" End
function exponent(base,exp) x = 1 for i = 1 to exp x = x * base 'the value of x is looped and raised by one power again print right$(space$(30);addcomma$(x), 30) next i print "" exponent = x end function
function addcomma$(v) if v<0 then s$="-" : v=abs(v) '-sign ? i=int(v) 'absolute integer part d=v-i 'decimal part if d<>0 then d$=mid$(str$(d),2) 'remove leading 0 i$=str$(i) l=len(i$) for n=l to 1 step-1 c=c+1 if c=4 then c=1 : o$=","+o$ o$=mid$(i$,n,1)+o$ next addcomma$=s$+o$+d$ end function
b = b + ...
|
|
xcoder
Member in Training
Posts: 52
|
Post by xcoder on Aug 26, 2023 2:03:13 GMT
Goodbye! Adios!! Sayanara! Lagorn, Zaijian! I am finished.
|
|
|
Post by cundo on Aug 26, 2023 21:06:09 GMT
Goodbye! Adios!! Sayanara! Lagorn, Zaijian! I am finished. Hi there. Why do you say you are finished?
|
|