![]() |
| Forums | Gaming News | Videos | Downloads | Today's Posts | Mark Forums Read | Chat | FAQ | Members List | Contact |
| ||||||
This is a discussion on Fibonacci Sequence Source Code Help within the PSP Development Forum forums, part of the PSP Development, Hacks, and Homebrew category; Ok I just have finished my Fibonacci sequence program, however I am trying to learn more about the meens of ...
![]() |
|
|
LinkBack | Thread Tools |
|
|
#1 | ||
|
Ok I just have finished my Fibonacci sequence program, however I am trying to learn more about the meens of input for the psp.(I am ridiculously new to this).
Without the if statement: Quote:
Here is my source code, can anyone help me? Quote:
|
|||
|
|
|
|
|
#2 | |
![]() ![]() ![]() Developer
|
Quote:
|
|
|
|
|
|
|
#3 |
![]() ![]() ...in a dream...
|
As weltall said, add
Code:
sceCtrlReadBuffer(&pad,1); // or sceCtrlPeekBuffer(&pad,1); P.S. You don't need to put the == 1 there, or anywhere in a comparitive statement for that matter, as all conditions in a comparitive statement are compared to 'true' (1) default. Hence why: Code:
while(1) { }
__________________
...you'll never know what it's like... spending your whole life in a dream...
Launch a Kitten out of a Cannon and win real cash! Checkout my newly updated site for all my projects (Kitten Cannon, BOXHEAD, Light Cycle 3D) |
|
|
|
|
|
#5 |
![]() ![]() Developer
|
Uh... he just did by posting the complete source? Apart from that, it does nothing else then calculate the fibonacci sequence from 0 to 24. Nothing seriously complicated or usefull.
... That's what I call hyping
__________________
Raphs board rules #31: Excessive use of punctuation is either a sign of a lesser ego or a small mind. Avoid it if you don't want to look like a total moron. Raphs board rules #17: When you need to ask whether you are capable of doing something, you are not. Raphs board rules #2: Exploits aren't found by changing version numbers, blindly merging data into a file or turning your PSP upside down. Raphs board rules #1: If you have no clue how exploits work, don't come up with ideas about them. |
|
|
|
|
|
#6 | |
|
Quote:
i would like to thank everyone for there help!
|
||
|
|
|
|
|
#7 |
![]() ![]() Muppet Magnet
|
I'd be surprised if it works with just that change. Looks to me like the while loop will never exit, and so you'll just print the first number in the sequence, and nothing more.
Assuming that you're trying to display the next item in the sequence when X is pressed, it would be better to do something like: Code:
for (i = 0; i < 24; i++)
{
loopVar = 1;
while(loopVar == 1)
{
sceCtrlReadBuffer(&pad,1);
if(pad.Buttons & PSP_CTRL_CROSS)
{
printf("%3d %6d\n", i, fib[i]);
loopVar = 0;
// the following fragment also helps to avoid lots of numbers with one press, and shows an alternative way to do the loop above.
while (pad.Buttons & PSP_CTRL_CROSS)
{
sceCtrlReadBuffer(&pad, 1);
}
}
}
}
__________________
Using firmware v2.00-v3.50? Open up a whole world of homebrew here
The PSP Homebrew Database needs YOU! Your ISP may be illegally wiretapping all your web activity. Stop Phorm Now! Visiting the Edinburgh Festivals? Get practical advice from experts. |
|
|
|
|
|
#10 | ||
|
My code currentley:
Quote:
Quote:
|
|||
|
|
|
|
|
#11 |
![]() ![]() Developer
|
Code:
sceKernelRegisterExitCall back(cbid); Also make sure you link -lpspctrl in your makefile.
__________________
Raphs board rules #31: Excessive use of punctuation is either a sign of a lesser ego or a small mind. Avoid it if you don't want to look like a total moron. Raphs board rules #17: When you need to ask whether you are capable of doing something, you are not. Raphs board rules #2: Exploits aren't found by changing version numbers, blindly merging data into a file or turning your PSP upside down. Raphs board rules #1: If you have no clue how exploits work, don't come up with ideas about them. |
|
|
|
|
|
#13 |
![]() ![]() Muppet Magnet
|
You need to make sure the libs line in your makefile includes "-lctrl".
__________________
Using firmware v2.00-v3.50? Open up a whole world of homebrew here
The PSP Homebrew Database needs YOU! Your ISP may be illegally wiretapping all your web activity. Stop Phorm Now! Visiting the Edinburgh Festivals? Get practical advice from experts. |
|
|
|
![]() |
| Tags |
| code , fibonacci , sequence , source |
| Thread Tools | |
|
|