Advertisement
ABCanG

Untitled

Feb 4th, 2012
169
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 1.43 KB | None | 0 0
  1. //Ecuaciones
  2. #include <pspkernel.h>
  3. #include <pspdebug.h>
  4. #include <pspcallbacks.h>
  5. #include <pspctrl.h>
  6.  
  7. PSP_MODULE_INFO("Ecuaciones",0,1,1);
  8. #define printf pspDebugScreenPrintf
  9.  
  10.    
  11. float a;
  12. float b;
  13. float c;
  14. float inversa;
  15. float dintre;
  16. double arrel;
  17. double sol1;
  18. double sol2;
  19. double sol11;
  20. double sol;
  21. double sol22;
  22.  
  23. char Later[3] = "ABC";
  24. float *abc[3] = {
  25.     &a,
  26.     &b,
  27.     &c
  28. };
  29.  
  30. void DecisionFactor(int num)
  31. {
  32.     printf("\n change value (%c) to press UP or Down", Later[num]);
  33.     printf("\n And enter to press X");
  34.     *abc[num] = 0;
  35.     while(1) {
  36.         sceCtrlReadBufferPositive(&pad, 1);
  37.         if(pad.Buttons & PSP_CTRL_UP)
  38.         {
  39.             *abc[num]++;
  40.             printf("\n %c: %.0f: ",Later[num] ,*abc[num]);
  41.         }
  42.         else if(pad.Buttons & PSP_CTRL_DOWN)
  43.         {
  44.             *abc[num]--;
  45.             printf("\n %c: %.0f: ",Later[num],*abc[num]);
  46.         }
  47.         else if(pad.Buttons & PSP_CTRL_CROSS)
  48.         {
  49.             break;
  50.         }
  51.         sceKernelDelayThread(100 * 1000);
  52.     }
  53. }
  54.  
  55.  
  56. int main() {
  57.     pspDebugScreenInit();
  58.     pspDebugScreenClear();
  59.     SetupCallbacks();
  60.     SceCtrlData pad;
  61.     printf("a(x^2)+b(x)+c\n");
  62.     printf("\nIngrese el coeficiente a de la ecuacion: ");
  63.    
  64.     DecisionFactor(1);//a
  65.     DecisionFactor(2);//b
  66.     DecisionFactor(3);//c
  67.    
  68.     printf("\nApreta cualquier tecla para salir...\n");
  69.     while(1)
  70.     {
  71.         sceKernelDelayThread(100 * 1000);
  72.         sceCtrlReadBufferPositive(&pad, 1);
  73.         if(pad.Buttons & PSP_CTRL_CIRCLE)
  74.         {
  75.             break;
  76.         }
  77.     }
  78.     sceKernelSleepThread();
  79.     return 0;
  80. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement