Guest User

Untitled

a guest
May 22nd, 2018
71
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.81 KB | None | 0 0
  1. #include <stdio.h>
  2. #include <dos.h>
  3. #include <stdlib.h>
  4.  
  5. void scriviCar(char col, char car, int pos);
  6. void setvideo();
  7. void interrupt (*oldInt)();
  8. void interrupt miaInt();
  9. int dir, pos, posp, cont;
  10. char col=0x7;
  11. char car=0x2;
  12.  
  13. int main()
  14. {
  15. setvideo();
  16. randomize();
  17. oldInt=getvect(0x1c);
  18. setvect(0x1c, miaInt);
  19. keep(0,(_SS+(_SP/16)-_psp));
  20. return 0;
  21. }
  22.  
  23. int trollolol()
  24. {
  25. dir=random(4);
  26. switch(dir)
  27. {
  28. case 0:pos-=160;
  29. break;
  30. case 1:pos-=2;
  31. break;
  32. case 2:pos+=160;
  33. break;
  34. case 3:pos+=2;
  35. break;
  36. }
  37. return pos;
  38.  
  39. }
  40.  
  41. void interrupt miaInt()
  42. {
  43. cont++;
  44. if(cont==4)
  45. {
  46. int i;
  47. cont=0;
  48. pos=trollollol();
  49. scriviCar(col,' ',posp);
  50. scriviCar(col,car,pos);
  51. posp=pos;
  52. }
  53. }
Add Comment
Please, Sign In to add comment