Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Aliens Among Us
#1
I just saw a video and hey they are right here in this!
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

To be continued... as soon as I get it coded  ;-))

Meanwhile wonder WTH?

Oh better yet, try to anticipate where I am going with this.
b = b + ...
Reply


Messages In This Thread
Aliens Among Us - by bplus - 10-10-2022, 05:20 PM
RE: Aliens Among Us - by bplus - 10-10-2022, 09:42 PM
RE: Aliens Among Us - by James D Jarvis - 10-10-2022, 09:44 PM
RE: Aliens Among Us - by bplus - 10-10-2022, 11:10 PM
RE: Aliens Among Us - by Pete - 10-17-2022, 10:13 PM



Users browsing this thread: 6 Guest(s)