{"id":44605467,"url":"https://github.com/kristopherjohnson/lunar-prolog","last_synced_at":"2026-02-14T10:35:54.182Z","repository":{"id":298562305,"uuid":"998107899","full_name":"kristopherjohnson/lunar-prolog","owner":"kristopherjohnson","description":"Port of classic text-based lunar lander game to Prolog","archived":false,"fork":false,"pushed_at":"2025-07-13T22:47:23.000Z","size":14,"stargazers_count":1,"open_issues_count":1,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-01-13T02:52:39.158Z","etag":null,"topics":["ciao-prolog","console-game","gprolog","lunar-lander","prolog","retrogaming","swipl"],"latest_commit_sha":null,"homepage":"https://undefinedvalue.com/lunar-for-c-and-rust.html","language":"Prolog","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/kristopherjohnson.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2025-06-07T21:58:58.000Z","updated_at":"2025-07-31T23:44:34.000Z","dependencies_parsed_at":null,"dependency_job_id":"ba76a09e-abb1-4faa-8d22-db504ffff2fd","html_url":"https://github.com/kristopherjohnson/lunar-prolog","commit_stats":null,"previous_names":["kristopherjohnson/lunar-prolog"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/kristopherjohnson/lunar-prolog","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kristopherjohnson%2Flunar-prolog","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kristopherjohnson%2Flunar-prolog/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kristopherjohnson%2Flunar-prolog/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kristopherjohnson%2Flunar-prolog/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/kristopherjohnson","download_url":"https://codeload.github.com/kristopherjohnson/lunar-prolog/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kristopherjohnson%2Flunar-prolog/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29442783,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-14T10:17:46.583Z","status":"ssl_error","status_checked_at":"2026-02-14T10:17:22.534Z","response_time":53,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["ciao-prolog","console-game","gprolog","lunar-lander","prolog","retrogaming","swipl"],"created_at":"2026-02-14T10:35:54.021Z","updated_at":"2026-02-14T10:35:54.177Z","avatar_url":"https://github.com/kristopherjohnson.png","language":"Prolog","funding_links":[],"categories":[],"sub_categories":[],"readme":"LUNAR for Prolog\n================\n\nThis is a port of a classic text-based [\"lunar lander\" game][lunarlander] to [Prolog][prolog].\n\nThe first time I saw a computer was when my father took me to an open-house at the IBM headquarters in Atlanta in the late 1970's, when I was around ten years old.  I wasn't impressed with the big sterile glass rooms filled with big orange computers, but there was a room in the basement where a couple of bearded guys asked me to sit down at a terminal and play a game.\n\nIt was this lunar landing game.  For each ten seconds of game time, it asks how much thrust you want to use, and then it tells you your new altitude, velocity, and remaining fuel.  I crashed, and then I had to get up to let the next kid take a turn.\n\nIt was simple, primitive even, but I was immediately fascinated with computers.  I saw that a computer would let me create little simulated universes that followed whatever rules I could imagine.\n\nSo after that I kept bugging my dad to buy me books about programming.  A couple of years later, my parents bought me a computer.  Thanks Mom and Dad!\n\nI did some research, and I found the [original Lunar Lander program by Jim Storer][storerlunarlander], written in the [FOCAL programming language][wpfocal] in 1969.  I've rewritten it in Prolog so that it can be run on modern systems with Prolog installed.  The program here is pretty close to what I remember.  One difference is that, on crashing into the moon surface, that program announced \"IT'S ALL OVER BUT THE SHOUTING\", which confused me as a ten-year-old.  I thought the shouting was for joy.\n\nThis code is based upon these sources:\n\n* [Jim Storer's original lunar landing simulation code in FOCAL][storer]\n* [FOCAL Programming Manual][focal]\n* [David Ahl's port to BASIC in _BASIC Computer Games_ (1978)][ahl]\n\n## Running with SWI-Prolog\n\nIf you have [SWI-Prolog][swiprolog] installed, you can run the game by executing this command:\n\n```\nswipl lunar.pl\n```\n\nAlternatively, you can start SWI-Prolog and then load the file:\n\n```\nswipl\n?- [lunar].\n```\n\n## Running with GNU Prolog\n\nIf you have [GNU Prolog](http://gprolog.org/) installed, you can run the game by executing this command:\n\n```\ngprolog --consult-file lunar.pl\n```\n\nAlternatively, you can start GNU Prolog and then load the file:\n\n```\ngprolog\n?- [lunar].\n```\n\n### Compiling with GNU Prolog\n\nYou can compile `lunar.pl` into a standalone executable using `gplc`:\n\n```\ngplc lunar.pl\n```\n\nThis will create an executable named `lunar` in the current directory, which you can then run directly:\n\n```\n./lunar\n```\n\n## Running with Ciao Prolog\n\nIf you have [Ciao Prolog](https://ciao-lang.org/) installed, you can run the game by executing this command:\n\n```\nciao run lunar.pl\n```\n\nOr, you can start the Ciao shell and then load the file:\n\n```\nciao\n?- [lunar].\n```\n\n### Compiling with Ciao Prolog\n\nYou can compile `lunar.pl` into a standalone executable using `ciaoc`:\n\n```\nciaoc -o lunar lunar.pl\n```\n\nThis will create an executable named `lunar` in the current directory, which you can then run directly:\n\n```\n./lunar\n```\n\n## Example of Play\n\nHere is an example play session:\n\n```\nCONTROL CALLING LUNAR MODULE. MANUAL CONTROL IS NECESSARY\nYOU MAY RESET FUEL RATE K EACH 10 SECS TO 0 OR ANY VALUE\nBETWEEN 8 \u0026 200 LBS/SEC. YOU'VE 16000 LBS FUEL. ESTIMATED\nFREE FALL IMPACT TIME-120 SECS. CAPSULE WEIGHT-32500 LBS\n\n\nFIRST RADAR CHECK COMING UP\n\n\nCOMMENCE LANDING PROCEDURE\nTIME,SECS   ALTITUDE,MILES+FEET   VELOCITY,MPH   FUEL,LBS   FUEL RATE\n      0             120      0        3600.00     16000.0      K=:0\n     10             109   5016        3636.00     16000.0      K=:0\n     20              99   4224        3672.00     16000.0      K=:0\n     30              89   2904        3708.00     16000.0      K=:0\n     40              79   1056        3744.00     16000.0      K=:0\n     50              68   3960        3780.00     16000.0      K=:0\n     60              58   1056        3816.00     16000.0      K=:0\n     70              47   2904        3852.00     16000.0      K=:170\n     80              37   1474        3539.86     14300.0      K=:200\n     90              27   5247        3140.80     12300.0      K=:200\n    100              19   4537        2710.41     10300.0      K=:200\n    110              12   5118        2243.83      8300.0      K=:200\n    120               7   2285        1734.97      6300.0      K=:200\n    130               3   1990        1176.06      4300.0      K=:200\n    140               0   5040         556.96      2300.0      K=:170\n    150               0   1040         -21.20       600.0      K=:0\n    160               0   1087          14.80       600.0      K=:0\n    170               0    606          50.80       600.0      K=:30\n    180               0    436         -27.90       300.0      K=:0\n    190               0    581           8.10       300.0      K=:8\n    200               0    425          13.17       220.0      K=:10\n    210               0    253          10.30       120.0      K=:9\n    220               0     95          11.11        30.0      K=:100\nFUEL OUT AT   220.30 SECS\nON THE MOON AT   226.11 SECS\nIMPACT VELOCITY OF    21.35 M.P.H.\nFUEL LEFT:     0.00 LBS\nCONGRATULATIONS ON A POOR LANDING\n\n\n\nTRY AGAIN?\n(ANS. YES OR NO):NO\nCONTROL OUT\n\n\n```\n\n[ahl]: https://www.atariarchives.org/basicgames/showpage.php?page=106\n[focal]: http://www.bitsavers.org/www.computer.museum.uq.edu.au/pdf/DEC-08-AJAB-D%20PDP-8-I%20FOCAL%20Programming%20Manual.pdf\n[homebrew]: https://brew.sh/\n[lunarlander]: https://en.wikipedia.org/wiki/Lunar_Lander_(video_game_genre)#Text_games\n[storer]: http://www.cs.brandeis.edu/~storer/LunarLander/LunarLander/LunarLanderListing.jpg\n[storerlunarlander]: https://www.cs.brandeis.edu/~storer/LunarLander/LunarLander.html\n[swiprolog]: https://www.swi-prolog.org/\n[wpfocal]: https://en.wikipedia.org/wiki/FOCAL_(programming_language)\n[prolog]: https://en.wikipedia.org/wiki/Prolog\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkristopherjohnson%2Flunar-prolog","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkristopherjohnson%2Flunar-prolog","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkristopherjohnson%2Flunar-prolog/lists"}