Giter VIP home page Giter VIP logo

zork's Introduction

README

This is a C++-17 port of the final 616-point Zork, written at MIT around 1978-1981. The goal was to do a port as directly as possible, meaning that the original logic, structures, functions, modules, etc. are ported as-is. Therefore, it is not necessarily the most "C++" way of doing things. The main exceptions to the MDL code are saving/restoring, which uses the Boost serialization libraries, and I/O, which uses C++ cin/cout. Restarting also needs platform-specific code to find the application's location. There is also no attempt to obfuscate or encrypt any of the text, rooms, puzzles, and so on. With the number of walkthroughs on the internet, it seems pointless to take such precautions.

A map of the 585-point version is here. It is missing three puzzles, but I could not find a more complete one. One additional modification: Use the "TERMINAL" command in Zork to simulate the feel of a 1970's-era terminal output.

Builds are supported for Linux (gcc-7 required) and Windows (32 and 64 bit, Visual Studio 2017 required). There is nothing using any non-standard C++ anywhere in the code, so it should be simple to port to other platforms. It also makes extensive use of C++-17 features, and thus a C++-17-compliant compiler is required.

Build requirements:

Boost (www.boost.org) - Requires the program_options and the serialization libraries. This build used version 1.70.0.

CMAKE BUILD

CMake Build Recipe (Tested in Ubuntu 18.04 w/ gcc 9.2.1).

From project folder:

$ sudo apt install libboost-all-dev
$ mkdir build
$ cd build
$ cmake ..
$ make

Party like it is 1979 ...

zork's People

Contributors

jclaar avatar jclaar4 avatar michaelveth avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

zork's Issues

Issue with your 585-point map

https://u.pcloud.link/publink/show?code=XZtedOXZS9FFLIh4HHSGeYd7Dr8Rb8Juhfwk

Here is a link to download my digital copy of the finalized 616-point map. This is the map the original creators made back in the day, but unlike the usual copy this one has been completed with the later puzzles... and the quality is perfect, not that old aged copy.

Sorry to submit this as an issue but I couldn't find another way easily.

...Jeremy Kapp

P.S. This is super high resolution and the size is 36x24, the standard poster size. Fit's a poster frame if printed.

Zork crashes if not in current path

Zork crashes if the executable is not in the current path:

$ which zork
/usr/games/zork
$ ls zork
ls: cannot access 'zork': No such file or directory
$ zork
terminate called after throwing an instance of 'boost::process::process_error'
what(): execve failed: No such file or directory

Patch for upstream version from Bitbucket

--- mdlfun.cpp	2019-12-28 22:40:39.384126978 +0000
+++ mdlfun.cpp	2019-12-28 23:04:55.587833908 +0000
@@ -9,6 +9,7 @@
 #pragma warning(disable: 4244)
 #include <boost/process.hpp>
 #pragma warning(default: 4244)
+#include <boost/dll.hpp>
 
 std::string pw(SIterator unm, SIterator key);
 std::string username();
@@ -54,7 +55,7 @@
 		// exit.
 		while (status == 1)
         {
-            boost::process::child c(argv[0], "-go");
+            boost::process::child c(boost::dll::program_location(), "-go");
             c.wait();
             status = c.exit_code();
         }

I also needed to add libboost_filesystem.a and -ldl for the link step in the makefile.

Arrow keys

Could you add support for left/right arrow keys to edit the command line in place and up/down arrows to access a command history?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.