Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //Ecuaciones
- #include <pspkernel.h>
- #include <pspdebug.h>
- #include <pspcallbacks.h>
- #include <pspctrl.h>
- PSP_MODULE_INFO("Ecuaciones",0,1,1);
- #define printf pspDebugScreenPrintf
- float a;
- float b;
- float c;
- float inversa;
- float dintre;
- double arrel;
- double sol1;
- double sol2;
- double sol11;
- double sol;
- double sol22;
- char Later[3] = "ABC";
- float *abc[3] = {
- &a,
- &b,
- &c
- };
- void DecisionFactor(int num)
- {
- printf("\n change value (%c) to press UP or Down", Later[num]);
- printf("\n And enter to press X");
- *abc[num] = 0;
- while(1) {
- sceCtrlReadBufferPositive(&pad, 1);
- if(pad.Buttons & PSP_CTRL_UP)
- {
- *abc[num]++;
- printf("\n %c: %.0f: ",Later[num] ,*abc[num]);
- }
- else if(pad.Buttons & PSP_CTRL_DOWN)
- {
- *abc[num]--;
- printf("\n %c: %.0f: ",Later[num],*abc[num]);
- }
- else if(pad.Buttons & PSP_CTRL_CROSS)
- {
- break;
- }
- sceKernelDelayThread(100 * 1000);
- }
- }
- int main() {
- pspDebugScreenInit();
- pspDebugScreenClear();
- SetupCallbacks();
- SceCtrlData pad;
- printf("a(x^2)+b(x)+c\n");
- printf("\nIngrese el coeficiente a de la ecuacion: ");
- DecisionFactor(1);//a
- DecisionFactor(2);//b
- DecisionFactor(3);//c
- printf("\nApreta cualquier tecla para salir...\n");
- while(1)
- {
- sceKernelDelayThread(100 * 1000);
- sceCtrlReadBufferPositive(&pad, 1);
- if(pad.Buttons & PSP_CTRL_CIRCLE)
- {
- break;
- }
- }
- sceKernelSleepThread();
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement