home *** CD-ROM | disk | FTP | other *** search
/ CP/M / CPM_CDROM.iso / mbug / mbug084.arc / SQUARES.CMD < prev    next >
OS/2 REXX Batch file  |  1979-12-31  |  1KB  |  66 lines

  1. eras
  2. set talk off
  3.  
  4. ?'do you want printout'
  5. SET CONS OFF
  6. WAIT TO F
  7. SET CONS ON
  8. STOR 'T' TO MORE
  9. DO WHIL MORE
  10. STOR 'T' TO T
  11. inpu'WHAT NUMBER?-ZERO TO QUIT'to a
  12. IF  A=0
  13. SET TALK ON
  14. RETU
  15. ENDIF
  16. inpu'TO WHAT POWER DO YOU WISH TO SEE IT RAISED?'to b
  17. stor a to c
  18. stor 1 to e
  19. stor 0 to d
  20. if !(F)='Y'
  21. set prin on
  22. endi
  23. ?'                    THE POWER OF MATHEMATICS'
  24. set prin off
  25. ?' accurate to ten numbers only!'
  26.  
  27. ?'                    ------------------------'
  28. ? A,'TO THE POWER OF            1 =',A
  29. set prin off
  30. do whil b>1
  31. set exact on
  32. stor a*c to c
  33. stor c+d to d
  34. stor b-1 to b
  35. stor 1+e to e
  36. if !(F)='Y'
  37. set prin on
  38. endif
  39. ? A,'TO THE POWER OF ',e,'=', c
  40. endif
  41. IF B=1
  42. ?
  43. ?'                    ------------------------'
  44. ?
  45. ENDIF
  46. set prin off
  47. set exact off
  48. enddo
  49. ENDDO
  50. SET TALK ON
  51. RETU
  52.  
  53. 
  54. set cons off
  55. wait to third
  56. set cons on
  57. do whil !(third) # 'G'
  58. ?'You didn`t press G - try again!'
  59. set cons off
  60. wait to third
  61. set cons on
  62. enddo
  63. ? chr(7)
  64. endif
  65. STOR 1+note TO NOTE
  66. if no