Advertisement
chemoelectric

Wraps at 80 but whatever

Mar 29th, 2023
2,678
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. 10 rem  Program for http://www.moria.de/~michael/bas/
  2. 20 defint a-z
  3. 30 dim stack(999)
  4. 40 sp = 0
  5. 50 var0 = 0
  6. 60 var1 = 0
  7. 70 var2 = 0
  8. 80 var3 = 0
  9. 90 var4 = 0
  10. 100 var5 = 0
  11. 110 var6 = 0
  12. 120 var7 = 0
  13. 130 var8 = 0
  14. 140 var9 = 0
  15. 150 var10 = 0
  16. 160 var11 = 0
  17. 170 var12 = 0
  18. 180 var13 = 0
  19. 190 var14 = 0
  20. 200 dim strings$(0)
  21. 210 goto 370
  22. 220 rem  Print strings$(i)
  23. 230 s$ = strings$(i)
  24. 240 rem  Print s$
  25. 250 n = len (s$)
  26. 260 i = 1
  27. 270 if n < i then return
  28. 280 c$ = mid$(s$, i, 1)
  29. 290 if c$ = "\" then c$ = mid$(s$, i, 2)
  30. 300 i = i + len(c$)
  31. 310 if c$ = "\n" then print ""
  32. 320 if c$ = "\\" then print "\";
  33. 330 if len(c$) = 2 then goto 270
  34. 340 print c$;
  35. 350 goto 270
  36. 360 rem  End of string printer.
  37. 370 rem
  38. 380 goto 390
  39. 390 rem
  40. 400 stack(sp) = 420
  41. 410 sp = sp + 1
  42. 420 goto 430
  43. 430 rem
  44. 440 stack(sp - 1) = -stack(sp - 1)
  45. 450 goto 460
  46. 460 rem
  47. 470 sp = sp - 1
  48. 480 var0 = stack(sp)
  49. 490 goto 500
  50. 500 rem
  51. 510 stack(sp) = 300
  52. 520 sp = sp + 1
  53. 530 goto 540
  54. 540 rem
  55. 550 sp = sp - 1
  56. 560 var1 = stack(sp)
  57. 570 goto 580
  58. 580 rem
  59. 590 stack(sp) = 300
  60. 600 sp = sp + 1
  61. 610 goto 620
  62. 620 rem
  63. 630 sp = sp - 1
  64. 640 var2 = stack(sp)
  65. 650 goto 660
  66. 660 rem
  67. 670 stack(sp) = 300
  68. 680 sp = sp + 1
  69. 690 goto 700
  70. 700 rem
  71. 710 stack(sp - 1) = -stack(sp - 1)
  72. 720 goto 730
  73. 730 rem
  74. 740 sp = sp - 1
  75. 750 var3 = stack(sp)
  76. 760 goto 770
  77. 770 rem
  78. 780 stack(sp) = 7
  79. 790 sp = sp + 1
  80. 800 goto 810
  81. 810 rem
  82. 820 sp = sp - 1
  83. 830 var4 = stack(sp)
  84. 840 goto 850
  85. 850 rem
  86. 860 stack(sp) = 15
  87. 870 sp = sp + 1
  88. 880 goto 890
  89. 890 rem
  90. 900 sp = sp - 1
  91. 910 var5 = stack(sp)
  92. 920 goto 930
  93. 930 rem
  94. 940 stack(sp) = 200
  95. 950 sp = sp + 1
  96. 960 goto 970
  97. 970 rem
  98. 980 sp = sp - 1
  99. 990 var6 = stack(sp)
  100. 1000 goto 1010
  101. 1010 rem
  102. 1020 stack(sp) = var2
  103. 1030 sp = sp + 1
  104. 1040 goto 1050
  105. 1050 rem
  106. 1060 sp = sp - 1
  107. 1070 var7 = stack(sp)
  108. 1080 goto 1090
  109. 1090 rem
  110. 1100 stack(sp) = var7
  111. 1110 sp = sp + 1
  112. 1120 goto 1130
  113. 1130 rem
  114. 1140 stack(sp) = var3
  115. 1150 sp = sp + 1
  116. 1160 goto 1170
  117. 1170 rem
  118. 1180 sp = sp - 1
  119. 1190 if stack(sp - 1) > stack(sp) then goto 1220
  120. 1200 stack(sp - 1) = 0
  121. 1210 goto 1230
  122. 1220 stack(sp - 1) = 1
  123. 1230 rem
  124. 1240 goto 1250
  125. 1250 rem
  126. 1260 sp = sp - 1
  127. 1270 if stack(sp) = 0 then goto 4630
  128. 1280 goto 1290
  129. 1290 rem
  130. 1300 stack(sp) = var0
  131. 1310 sp = sp + 1
  132. 1320 goto 1330
  133. 1330 rem
  134. 1340 sp = sp - 1
  135. 1350 var8 = stack(sp)
  136. 1360 goto 1370
  137. 1370 rem
  138. 1380 stack(sp) = var8
  139. 1390 sp = sp + 1
  140. 1400 goto 1410
  141. 1410 rem
  142. 1420 stack(sp) = var1
  143. 1430 sp = sp + 1
  144. 1440 goto 1450
  145. 1450 rem
  146. 1460 sp = sp - 1
  147. 1470 if stack(sp - 1) < stack(sp) then goto 1500
  148. 1480 stack(sp - 1) = 0
  149. 1490 goto 1510
  150. 1500 stack(sp - 1) = 1
  151. 1510 rem
  152. 1520 goto 1530
  153. 1530 rem
  154. 1540 sp = sp - 1
  155. 1550 if stack(sp) = 0 then goto 4370
  156. 1560 goto 1570
  157. 1570 rem
  158. 1580 stack(sp) = 0
  159. 1590 sp = sp + 1
  160. 1600 goto 1610
  161. 1610 rem
  162. 1620 sp = sp - 1
  163. 1630 var9 = stack(sp)
  164. 1640 goto 1650
  165. 1650 rem
  166. 1660 stack(sp) = 0
  167. 1670 sp = sp + 1
  168. 1680 goto 1690
  169. 1690 rem
  170. 1700 sp = sp - 1
  171. 1710 var10 = stack(sp)
  172. 1720 goto 1730
  173. 1730 rem
  174. 1740 stack(sp) = 32
  175. 1750 sp = sp + 1
  176. 1760 goto 1770
  177. 1770 rem
  178. 1780 sp = sp - 1
  179. 1790 var11 = stack(sp)
  180. 1800 goto 1810
  181. 1810 rem
  182. 1820 stack(sp) = 0
  183. 1830 sp = sp + 1
  184. 1840 goto 1850
  185. 1850 rem
  186. 1860 sp = sp - 1
  187. 1870 var12 = stack(sp)
  188. 1880 goto 1890
  189. 1890 rem
  190. 1900 stack(sp) = var12
  191. 1910 sp = sp + 1
  192. 1920 goto 1930
  193. 1930 rem
  194. 1940 stack(sp) = var6
  195. 1950 sp = sp + 1
  196. 1960 goto 1970
  197. 1970 rem
  198. 1980 sp = sp - 1
  199. 1990 if stack(sp - 1) < stack(sp) then goto 2020
  200. 2000 stack(sp - 1) = 0
  201. 2010 goto 2030
  202. 2020 stack(sp - 1) = 1
  203. 2030 rem
  204. 2040 goto 2050
  205. 2050 rem
  206. 2060 sp = sp - 1
  207. 2070 if stack(sp) = 0 then goto 4110
  208. 2080 goto 2090
  209. 2090 rem
  210. 2100 stack(sp) = var10
  211. 2110 sp = sp + 1
  212. 2120 goto 2130
  213. 2130 rem
  214. 2140 stack(sp) = var10
  215. 2150 sp = sp + 1
  216. 2160 goto 2170
  217. 2170 rem
  218. 2180 sp = sp - 1
  219. 2190 stack(sp - 1) = stack(sp - 1) * stack(sp)
  220. 2200 goto 2210
  221. 2210 rem
  222. 2220 stack(sp) = 200
  223. 2230 sp = sp + 1
  224. 2240 goto 2250
  225. 2250 rem
  226. 2260 sp = sp - 1
  227. 2270 stack(sp - 1) = stack(sp - 1) \ stack(sp)
  228. 2280 goto 2290
  229. 2290 rem
  230. 2300 sp = sp - 1
  231. 2310 var13 = stack(sp)
  232. 2320 goto 2330
  233. 2330 rem
  234. 2340 stack(sp) = var9
  235. 2350 sp = sp + 1
  236. 2360 goto 2370
  237. 2370 rem
  238. 2380 stack(sp) = var9
  239. 2390 sp = sp + 1
  240. 2400 goto 2410
  241. 2410 rem
  242. 2420 sp = sp - 1
  243. 2430 stack(sp - 1) = stack(sp - 1) * stack(sp)
  244. 2440 goto 2450
  245. 2450 rem
  246. 2460 stack(sp) = 200
  247. 2470 sp = sp + 1
  248. 2480 goto 2490
  249. 2490 rem
  250. 2500 sp = sp - 1
  251. 2510 stack(sp - 1) = stack(sp - 1) \ stack(sp)
  252. 2520 goto 2530
  253. 2530 rem
  254. 2540 sp = sp - 1
  255. 2550 var14 = stack(sp)
  256. 2560 goto 2570
  257. 2570 rem
  258. 2580 stack(sp) = var13
  259. 2590 sp = sp + 1
  260. 2600 goto 2610
  261. 2610 rem
  262. 2620 stack(sp) = var14
  263. 2630 sp = sp + 1
  264. 2640 goto 2650
  265. 2650 rem
  266. 2660 sp = sp - 1
  267. 2670 stack(sp - 1) = stack(sp - 1) + stack(sp)
  268. 2680 goto 2690
  269. 2690 rem
  270. 2700 stack(sp) = 800
  271. 2710 sp = sp + 1
  272. 2720 goto 2730
  273. 2730 rem
  274. 2740 sp = sp - 1
  275. 2750 if stack(sp - 1) > stack(sp) then goto 2780
  276. 2760 stack(sp - 1) = 0
  277. 2770 goto 2790
  278. 2780 stack(sp - 1) = 1
  279. 2790 rem
  280. 2800 goto 2810
  281. 2810 rem
  282. 2820 sp = sp - 1
  283. 2830 if stack(sp) = 0 then goto 3370
  284. 2840 goto 2850
  285. 2850 rem
  286. 2860 stack(sp) = 48
  287. 2870 sp = sp + 1
  288. 2880 goto 2890
  289. 2890 rem
  290. 2900 stack(sp) = var12
  291. 2910 sp = sp + 1
  292. 2920 goto 2930
  293. 2930 rem
  294. 2940 sp = sp - 1
  295. 2950 stack(sp - 1) = stack(sp - 1) + stack(sp)
  296. 2960 goto 2970
  297. 2970 rem
  298. 2980 sp = sp - 1
  299. 2990 var11 = stack(sp)
  300. 3000 goto 3010
  301. 3010 rem
  302. 3020 stack(sp) = var12
  303. 3030 sp = sp + 1
  304. 3040 goto 3050
  305. 3050 rem
  306. 3060 stack(sp) = 9
  307. 3070 sp = sp + 1
  308. 3080 goto 3090
  309. 3090 rem
  310. 3100 sp = sp - 1
  311. 3110 if stack(sp - 1) > stack(sp) then goto 3140
  312. 3120 stack(sp - 1) = 0
  313. 3130 goto 3150
  314. 3140 stack(sp - 1) = 1
  315. 3150 rem
  316. 3160 goto 3170
  317. 3170 rem
  318. 3180 sp = sp - 1
  319. 3190 if stack(sp) = 0 then goto 3290
  320. 3200 goto 3210
  321. 3210 rem
  322. 3220 stack(sp) = 64
  323. 3230 sp = sp + 1
  324. 3240 goto 3250
  325. 3250 rem
  326. 3260 sp = sp - 1
  327. 3270 var11 = stack(sp)
  328. 3280 goto 3290
  329. 3290 rem
  330. 3300 stack(sp) = var6
  331. 3310 sp = sp + 1
  332. 3320 goto 3330
  333. 3330 rem
  334. 3340 sp = sp - 1
  335. 3350 var12 = stack(sp)
  336. 3360 goto 3370
  337. 3370 rem
  338. 3380 stack(sp) = var10
  339. 3390 sp = sp + 1
  340. 3400 goto 3410
  341. 3410 rem
  342. 3420 stack(sp) = var9
  343. 3430 sp = sp + 1
  344. 3440 goto 3450
  345. 3450 rem
  346. 3460 sp = sp - 1
  347. 3470 stack(sp - 1) = stack(sp - 1) * stack(sp)
  348. 3480 goto 3490
  349. 3490 rem
  350. 3500 stack(sp) = 100
  351. 3510 sp = sp + 1
  352. 3520 goto 3530
  353. 3530 rem
  354. 3540 sp = sp - 1
  355. 3550 stack(sp - 1) = stack(sp - 1) \ stack(sp)
  356. 3560 goto 3570
  357. 3570 rem
  358. 3580 stack(sp) = var7
  359. 3590 sp = sp + 1
  360. 3600 goto 3610
  361. 3610 rem
  362. 3620 sp = sp - 1
  363. 3630 stack(sp - 1) = stack(sp - 1) + stack(sp)
  364. 3640 goto 3650
  365. 3650 rem
  366. 3660 sp = sp - 1
  367. 3670 var9 = stack(sp)
  368. 3680 goto 3690
  369. 3690 rem
  370. 3700 stack(sp) = var13
  371. 3710 sp = sp + 1
  372. 3720 goto 3730
  373. 3730 rem
  374. 3740 stack(sp) = var14
  375. 3750 sp = sp + 1
  376. 3760 goto 3770
  377. 3770 rem
  378. 3780 sp = sp - 1
  379. 3790 stack(sp - 1) = stack(sp - 1) - stack(sp)
  380. 3800 goto 3810
  381. 3810 rem
  382. 3820 stack(sp) = var8
  383. 3830 sp = sp + 1
  384. 3840 goto 3850
  385. 3850 rem
  386. 3860 sp = sp - 1
  387. 3870 stack(sp - 1) = stack(sp - 1) + stack(sp)
  388. 3880 goto 3890
  389. 3890 rem
  390. 3900 sp = sp - 1
  391. 3910 var10 = stack(sp)
  392. 3920 goto 3930
  393. 3930 rem
  394. 3940 stack(sp) = var12
  395. 3950 sp = sp + 1
  396. 3960 goto 3970
  397. 3970 rem
  398. 3980 stack(sp) = 1
  399. 3990 sp = sp + 1
  400. 4000 goto 4010
  401. 4010 rem
  402. 4020 sp = sp - 1
  403. 4030 stack(sp - 1) = stack(sp - 1) + stack(sp)
  404. 4040 goto 4050
  405. 4050 rem
  406. 4060 sp = sp - 1
  407. 4070 var12 = stack(sp)
  408. 4080 goto 4090
  409. 4090 rem
  410. 4100 goto 1890
  411. 4110 rem
  412. 4120 stack(sp) = var11
  413. 4130 sp = sp + 1
  414. 4140 goto 4150
  415. 4150 rem
  416. 4160 sp = sp - 1
  417. 4170 print chr$(stack(sp));
  418. 4180 goto 4190
  419. 4190 rem
  420. 4200 stack(sp) = var8
  421. 4210 sp = sp + 1
  422. 4220 goto 4230
  423. 4230 rem
  424. 4240 stack(sp) = var4
  425. 4250 sp = sp + 1
  426. 4260 goto 4270
  427. 4270 rem
  428. 4280 sp = sp - 1
  429. 4290 stack(sp - 1) = stack(sp - 1) + stack(sp)
  430. 4300 goto 4310
  431. 4310 rem
  432. 4320 sp = sp - 1
  433. 4330 var8 = stack(sp)
  434. 4340 goto 4350
  435. 4350 rem
  436. 4360 goto 1370
  437. 4370 rem
  438. 4380 stack(sp) = 10
  439. 4390 sp = sp + 1
  440. 4400 goto 4410
  441. 4410 rem
  442. 4420 sp = sp - 1
  443. 4430 print chr$(stack(sp));
  444. 4440 goto 4450
  445. 4450 rem
  446. 4460 stack(sp) = var7
  447. 4470 sp = sp + 1
  448. 4480 goto 4490
  449. 4490 rem
  450. 4500 stack(sp) = var5
  451. 4510 sp = sp + 1
  452. 4520 goto 4530
  453. 4530 rem
  454. 4540 sp = sp - 1
  455. 4550 stack(sp - 1) = stack(sp - 1) - stack(sp)
  456. 4560 goto 4570
  457. 4570 rem
  458. 4580 sp = sp - 1
  459. 4590 var7 = stack(sp)
  460. 4600 goto 4610
  461. 4610 rem
  462. 4620 goto 1090
  463. 4630 rem
  464. 4640 goto 4650
  465. 4650 rem  End of program.
  466.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement