
April 27th, 2011, 06:47 PM
|
|
n00b DevH'er
|
|
Join Date: Apr 2011
Posts: 2
Time spent in forums: 17 m 17 sec
Reputation Power: 0
|
|
|
Programming for Pascal's Triangle?
Basically, I'm trying to make a program that when I give it a row number for Pascal's Triangle, it will give me all of the coefficients
So far I have
:ClrHome
:Prompt N(for the Row Number)
:Promt R(This is always going to be 0, you'll see why I use it later)
:N nCr R ->Z
: Disp Z
:If (N-1)(Insert Does not Equal sign here :P)0
:Then N nCr (R+1)
What I'm trying to do is if the row number is 1, there is only 2 coefficients, so I want to to stop after those two instead of keep spitting 0's which would be a result of if I programmed it to go to like 100. So I want to to recognize that If N-1 = 0, stop, if not go on. How would I do that? O.o
|