--- title: "Paqman" id: 72968 type: "computer_media" slug: "paqman" url: "http://localhost/computer_media/paqman/" markdown_url: "http://localhost/computer_media/paqman.md" published_at: "2026-10-27T21:30:07+00:00" modified_at: "2026-10-27T21:30:07+00:00" author: "David Anderson" featured_image: url: "http://localhost/wp-content/uploads/2026/10/paqman-1.png" excerpt: "A Pac-Man style maze game in SuperBASIC: eat the dots, dodge up to three ghosts and clear nineteen screens to earn the title of Grand Master." post_tag: - name: "Downloadable" slug: "downloadable" taxonomy: "post_tag" url: "http://localhost/tag/downloadable/" - name: "QL" slug: "ql" taxonomy: "post_tag" url: "http://localhost/tag/ql/" model: - name: "Sinclair QL" slug: "sinclair-ql" taxonomy: "model" url: "http://localhost/model/sinclair-ql/" indiv: - name: "S. N. Deary" slug: "s-n-deary" taxonomy: "indiv" url: "http://localhost/indiv/s-n-deary/" genre: - name: "Arcade" slug: "arcade" taxonomy: "genre" url: "http://localhost/type/arcade/" media_type: "Diskette" programmers: - name: "S. N. Deary" slug: "s-n-deary" taxonomy: "indiv" url: "http://localhost/indiv/s-n-deary/" download_url: "https://archive.org/download/timex-sinclair-software-archive/Paqman%20%281985%29%28Deary%2C%20S.%20N.%29%28Sinclair%20QL%29%28UK%29%28Program%29.zip" mediadate: "1985" images: - url: "http://localhost/wp-content/uploads/2026/10/paqman-1.png" media_type_tags: "Arcade" license: false --- # Paqman Paqman is a Pac-Man style maze game. You steer the paqman around a red and blue maze eating dots while ghosts chase you; you have three lives, each cleared screen earns a bonus, more ghosts join as the screens go on, and clearing nineteen screens wins the title of Grand Master. The REMs read “QL USER 1985” and credit S N Deary BSc, so it was a type-in from *QL User* magazine. ## Program Analysis The main loop draws the maze with user-defined characters, then repeats `move_man` and `move_ghost`; the chance of a ghost moving rises with the screen number (`handicap`). ### Potential Issues - The bonus is built as a string (`Screen&'000'`) and added to the score; SuperBASIC coerces it, so it works. It came from a QL owner’s floppy copies of QUANTA and IQLUG library material, imaged double-stepped so that only half of each disk survived; this file read back complete. The download holds the files exactly as recovered and a QL5A floppy image, *Paqman.img*, with the same files and their QDOS headers. Mount the image as FLP1_ (drop it on the QLRun page, or use it as a floppy image in sQLux, QPC2 or Q-emuLator) and type `lrun flp1_paqman_bas`. Tested in QLRun with the JS ROM: the maze and the start screen. ## Source Code ``` 10 REMark **** QL USER 1985 **** 20 REMark **** PAQMAN : Author SN Deary Bsc **** 100 initialise 110 REPeat forever 120 score=0 : lives=3 : Screen=1 130 REPeat screens 140 ghosts=Screen-1 : IF ghosts > 2 : ghosts=2 150 drawmaze 160 handicap=Screen+4 170 REPeat moves 180 move_man 190 IF RND(30)< handicap:move_ghost(RND(ghosts)) 200 IF end_of_screen:EXIT moves 210 END REPeat moves 220 IF max = 0 230 CLS : AT 5,12 : FLASH 1 240 PRINT 'Bonus ';Screen;'000' 250 score=score+(Screen&'000') 260 FLASH 0 : FOR i=1 TO 300 : i=i : REMark delay 270 Screen=Screen+1 280 END IF 290 IF lives < 1 : EXIT screens 300 IF Screen > 19 : EXIT screens 310 END REPeat screens 320 CLS 330 IF Screen > 19 340 PRINT 'You have won the title of Grand Master' 350 PRINT 'Too good for this game. I concede!!' 360 STOP 370 END IF 380 AT 5,10 : FLASH 1 390 PRINT 'G A M E O V E R' 400 FLASH 0 : FOR i=1 TO 1000: i=i: REMark delay 410 IF score > top_score:top_score=score 420 END REPeat forever 430 : 440 DEFine PROCedure move_man 450 INK 2 460 key=KEYROW(1) 470 row=man_row : col=man_col 480 IF key && 2 : col=col-1 : IF col < 0:IF row=5:col=18:ELSE col=0 490 IF key && 16 : col=col+1 : IF col > 18 : IF row=5 : col=0:ELSE col=18 500 IF key && 4 : row=row-1 : IF row <0 : IF col=9 : row=10 : ELSE row=0 510 IF key &&128 : row=row+1 : IF row > 10 : IF col = 9 : row=0 : ELSE row=10 520 prize=maze(row,col) 530 IF (prize&&1) OR key=0:RETurn 540 IF prize&&16:gotcha:RETurn 550 AT man_row,man_col*2:PRINT " "; 560 INK 6:AT row,col*2:PRINT man$; 570 BEEP 200,max 580 maze(row,col)=0 590 IF prize 600 score=score+prize 610 max=max-1 : IF max < 1 : end_of_screen=true 620 AT #4,0,6:PRINT #4,score; 630 END IF 640 man_row=row : man_col=col 650 END DEFine 660 : 670 DEFine PROCedure move_ghost(x) 680 row=ghost_row(x):col=ghost_col(x) 690 not_moved=true 700 IF ABS(man_row-row) < ABS(man_col-col) 710 horizontal:IF not_moved:col=ghost_col(x):vertical 720 ELSE vertical: IF not_moved:row=ghost_row(x):horizontal 730 END IF 740 END DEFine 750 : 760 DEFine PROCedure vertical 770 IF row=man_row : RETurn 780 IF man_row < row 790 row=row-1 : IF row >=0 : moveit 800 ELSE 810 row=row+1: IF row <=10 : moveit 820 END IF 825 END DEFine 830 : 840 DEFine PROCedure horizontal 850 IF col=man_col:RETurn 860 IF man_col