Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
27
Task/Floyds-triangle/OxygenBasic/floyds-triangle.basic
Normal file
27
Task/Floyds-triangle/OxygenBasic/floyds-triangle.basic
Normal file
|
|
@ -0,0 +1,27 @@
|
|||
function Floyd(sys n) as string
|
||||
sys i,t
|
||||
for i=1 to n
|
||||
t+=i
|
||||
next
|
||||
string s=str t
|
||||
sys le=1+len s
|
||||
string cr=chr(13,10)
|
||||
sys lc=len cr
|
||||
string buf=space(le*t+n*lc)
|
||||
sys j,o,p=1
|
||||
t=0
|
||||
for i=1 to n
|
||||
for j=1 to i
|
||||
t++
|
||||
s=str t
|
||||
o=le-len(s)-1 'right justify
|
||||
mid buf,p+o,str t
|
||||
p+=le
|
||||
next
|
||||
mid buf,p,cr
|
||||
p+=lc
|
||||
next
|
||||
return left buf,p-1
|
||||
end function
|
||||
|
||||
putfile "s.txt",Floyd(5)+floyd(14)
|
||||
Loading…
Add table
Add a link
Reference in a new issue