Really simple starter:
To get warmed up.
More serious display exercise:
Code: (Select All)
While 1
Cls
For i = 1 To 5
If i = 1 Then Pascal = i Else Pascal = Pascal * 11
P$ = LTrim$(Str$(Pascal))
For j = 1 To Len(P$)
Locate i, (5 - i) * 3 + j * 3 + (2 - (cnt Mod 2)) * i: Print Mid$(P$, j, 1);
Next
Print
Next
cnt = cnt + 1
_Limit 2
WendTo get warmed up.
More serious display exercise:
Code: (Select All)
_Title "Pascal Triangle display exercise 2018-01-13 bplus"
'2018-01-13 Pascal Triangle.txt for JB 2015-10-31 MGA/B+
_Define A-Z As _INTEGER64
Const xmax = 1200
Const ymax = 400
Screen _NewImage(xmax, ymax, 32)
_ScreenMove 100, 60
printline = 2
For row = 0 To 20
build$ = ""
printline = printline + 1
For column = 0 To row
build$ = build$ + Right$(Space$(7) + Str$(binom(row, column)), 7)
Next
Locate printline, (150 - Len(build$)) / 2
Print build$
Next
Sleep
Function binom (n, m)
binom = fac(n) / (fac(m) * fac((n - m)))
End Function
Function fac (n)
f = 1
For i = 1 To n
f = f * i
Next
fac = f
End Function
724 855 599 923 575 468 400 206 147 564 878 823 652 556 bxor cross forever

