Jay Fenlason's Hack

From NetHackWiki
(Redirected from Hack121)
Jump to navigation Jump to search

HACK is a roguelike role-playing game written by Jay Fenlason, with contributions from Kenny Woodland, Mike Thome, and Jon Payne, from which all subsequent versions of Hack and all versions of NetHack are descended. Jay Fenlason's Hack is the term given to the original Hack, without the extensive modifications by Andries Brouwer which are present in the more widely distributed version.

At present, source code for the original was long believed to be unavailable online; however, a preserved copy of Jay Fenlason’s original Hack project tree has since surfaced via academic and archival channels. This project tree, preserved by Brian Harvey, contains the working directory for the USENIX 82-1 submission as well as evidence of further iterative development.[1]

A DOS port with user interface changes is also available in binary form; all of Andries Brouwer’s versions are available as source code, and the source code for an early variant dubbed “Hack for PDP-11”, based on an early draft of Brouwer’s version, is also available.

Background

Development of Hack began in 1981 at Lincoln-Sudbury Regional High School in Massachusetts, where Jay Fenlason and other students had access to a PDP-11 system running Unix. The school’s computing environment, administered by a student-run Computer Center Users Society, emphasized experimentation and peer collaboration rather than formal coursework.[2]

Fenlason developed Hack as an original program exploring dungeon-based gameplay, focusing on procedural room and corridor generation, monster behavior, and item interaction. By the first half of 1982, Hack had reached a sufficiently complete state to be submitted for external distribution.

Hack was included in the USENIX 82-1 software distribution tape, submitted by Brian Harvey, then Computer Director at Lincoln-Sudbury. Contemporary evidence from *;login:* (Vol. 7, No. 3, June 1982) confirms that the tape had been completed prior to the Summer 1982 USENIX conference in Boston, where it was subsequently distributed. Hack therefore predates the conference presentations held at that meeting.[3]

The USENIX distribution tape also contained Jon Payne’s text editor JOVE. Although no online copy of the tape is known to exist, Hack was widely used by recipients and became one of the more notable programs included. Fenlason later recalled that following its inclusion on the USENIX distribution tape, Hack attracted considerable attention, with discussion often focusing on Hack alongside Jon Payne’s text editor JOVE.[4]

Variants

The original Hack developed by Jay Fenlason is now known to survive in the form of a preserved project tree, including the version submitted to the USENIX 82-1 distribution tape and evidence of further iterative development. Several derivative and ported versions of Hack were also created during the early 1980s. This section describes notable variants and ports that circulated independently of the original development tree.

Hack 1.21 (hack121)

A 16-color CGA-mode DOS port of Jay Fenlason's Hack is available in binary form at Ali Harlow's website as hack121.zip (mirror). It is known as "hack121", after the filename of its distribution package.

It refers to itself as version "1.21 (Slak was here!)", "Slak" apparently being Jay Fenlason himself; nonetheless, some changes have clearly been made by the porter (IBMgraphics and the fusion of mklev into hack).

See this newsgroup posting for a possible lead as to who ported it.

No source code for this program is known to exist, and it is not known for sure if the porter made any modifications which affect gameplay. Nonetheless, it is probably the closest to the original that is known to be extant.

Hack for PDP-11 and PC/IX Hack

Hack for PDP-11 is a variant developed by Michiel Huisjes and Fred de Wilde at the Free University (VU) in Amsterdam† (apparently based upon a early draft of Andries Brouwer's Hack, which was copied from his user area without his permission) and published on Usenet in February 1985. A port of this to a Unix clone called PC/IX (with a slightly different set of potions) was published in May by "peterb at pbear".

Despite its name, Hack for PDP-11 appears to require a nonstandard compiler, whereas it can be compiled on some later UNIX systems such as 4.2BSD without much work; it is possible that the compiler used was a contemporary version of the Amsterdam Compiler Kit, which dates from the early 1980s and which was developed at the VU.

The developers summarize their changes, in the Hack for PDP-11 readme, as:

"One of the main problems of Hack is its size. If you add about 1000 bytes of text more, your text segment will be to big. Therefore we saved text wherever this was possible. We removed the function fscanf(), and made the record file binary. To show the contents, use the program show (with flag -r).
"Some additions we (Fred de Wilde and Michiel Huisjes) made are
- The Vault
- The Swamp
- The Zoo
- The Graveyard
- Maxlevel = 40
- Proper Saving
- Several bugs
- And many, many more..."

"Proper saving" references the fact that saving was apparently broken in the sources that they originally obtained (as they mention in comments in the corresponding code).

PDP-11 Hack incorporates a time restriction preventing playing on working hours on weekdays, which grants exceptions for the developers' UIDs, and which is removed in the PC/IX version.

The shar files of both versions are archived at Google Groups:

Hack 1.0

Hack 1.0 was developed by Andries Brouwer and posted to Usenet in December 1984. All other versions of Hack and NetHack are descended from this version.

Main differences from Andries Brouwer’s Hack

Fenlason’s original Hack differs substantially from Andries Brouwer’s Hack 1.0 in both structure and gameplay systems. The preserved Fenlason codebase contains a single-character dungeon exploration game without roles, pets, shops, or other complex subsystems that later became central to Hack and NetHack.

Hack 1.0 introduces player roles, a formalized end goal centered on the Amulet of Yendor, a pet system, and multiple new gameplay subsystems including shops, special room types, and the segmented worm mechanic. Brouwer later described Hack 1.0 as being almost entirely rewritten relative to Fenlason’s original sources.

Some intermediate variants complicate this comparison. The DOS binary known as hack121 begins the game in a shop and includes an equipment purchase screen, but no source code for this version is known to survive. As a result, it is unclear whether these features reflect an otherwise lost later version of Fenlason’s Hack or were introduced by the porter.

Similarly, Hack for PDP-11 and PC/IX adds numerous gameplay systems absent from the original Fenlason code, including pets, vaults, zoos, swamps, and graveyards. Documentation for these ports indicates that many of these features were implemented by the port developers themselves rather than inherited from Fenlason’s original work.

Special room types

No special room types are present in the version of Hack submitted to the USENIX 82-1 software distribution tape. The preserved USENIX version contains no shops or other designated special rooms.

The DOS binary known as hack121 begins the game in a shop. This represents the earliest known appearance of a shop in any Hack-related variant. As no source code for hack121 is known to survive, and the provenance of the port is uncertain, it is not possible to determine whether the shop was introduced by the porter or derived from a later, now-lost version of Fenlason’s Hack.

Hack for PDP-11 and PC/IX includes shops as well as additional special room types such as zoos, graveyards, swamps, and vaults. According to the PDP-11 Hack documentation, these room types were implemented by the port’s developers themselves, with shops already present in the codebase they obtained. Vaults in particular are implemented in a manner distinct from later Hack and NetHack versions.

Andries Brouwer’s Hack reintroduces shops and expands the use of special room types, forming the basis for their continued development in later Hack and NetHack variants.

Mazes

PDP-11 Hack appears to contain the original makemaz() implementation of Fenlason's team, given this source code comment which does not appear in the refactored version of the function in Hack 1.0, and appears to reference Kenny Woodland by his first name:

/* This is all Kenny's fault.  He seems to have his x and y reversed */

Bestiary

The bestiaries of hack121 and PDP-11 Hack are listed below, along with the Hack 1.0 bestiary for comparison. Other monster descriptions may be lurking in other parts of the hack121 binary; therefore, this list cannot be considered as necessarily the final word for that version.

Main monster list

These are given in the order of their appearance in the code; it will be seen that the lists are quite similar.

Hack121 PDP-11 Hack Hack 1.0
bat (b) bat (B) bat (B)
lizard (l) gnome (G) gnome (G)
goblin (g) hobgoblin (H) hobgoblin (H)
jackal (j) jackal (J) jackal (J)
kobold (k) kobold (K) kobold (K)
pickpocket (p) leprechaun (L) leprechaun (L)
giant rat (r) giant rat (r) giant rat (r)
acid blob (a) acid blob (a) acid blob (a)
evil eye (e) floating eye (E) floating eye (E)
hurkle (h) homunculus (h) homunculus (h)
neevil (n) imp (i) imp (i)
orc (o) orc (O) orc (O)
yellow light (y) yellow light (y) yellow light (y)
zombie (z) zombie (Z) zombie (Z)
giant ant (A) giant ant (A) giant ant (A)
fog cloud (f) fog cloud (f) fog cloud (f)
robber (R) nymph (N) nymph (N)
stalactoid (s) piercer (p) piercer (p)
queevolt (q) quasit (Q) quasit (Q)
quivering blob (Q) quivering blob (q) quivering blob (q)
grabber (G) violet fungi (v) violet fungi (v)
nepto (N) giant beetle (b) giant beetle (b)
centaur (c) centaur (C) centaur (C)
cockatrice (C) cockatrice (c) cockatrice (c)
ghost (') gelatinous cube (g) gelatinous cube (g)
jaguar (J) jaguar (j) jaguar (j)
killer bee (K) killer bee (k) killer bee (k)
viper (v) snake (S) snake (S)
ice ball (i) freezing sphere (F) freezing sphere (F)
giant bear (B) owlbear (o) owlbear (o)
oxidizer (O) rust monster (R) rust monster (R)
unox (u) giant scorpion (s) scorpion (s)
teleporter (t) teleporter (t) tengu (t)
wraith (w) wraith (W) wraith (W)
snowman (S) long worm (w) long worm or wumpus (w)
octopus (0) large dog (d) large dog (d)
xyloman (x) leocrotta (l) leocrotta (l)
faker (F) mimic (M) mimic (M)
minotaur (m) minotaur (m) found at end of table
troll (T) troll (T) troll (T)
ugod (U) ugod (u) unicorn (u)
xerp (X) yeti (Y) yeti (Y)
phase shifter (P) invisible stalker (I) stalker (I)
hydra (H) umber hulk (U) umber hulk (U)
vampire (V) vampire (V) vampire (V)
wumpus (W) xorn (X) xorn (X)
rock lobster (L) xerp (x) xan (x)
zelomp (Z) zelomp (z) zruty (z)
chameleon (:) chameleon (:) chameleon (:)
dragon (D) dragon (D) dragon (D)
energar (E) ettin (e) ettin (e)
floor fiend (;) lurker above (') lurker above (~)
landshark (&) neo-otyugh (n) nurse (n)
argus (}) trapper (,) trapper (,)
mega-worm (M) purple worm (P) purple worm (P)
demon (d) demon (&) demon (&)
minotaur (m)
shopkeeper (@)

Other monsters kept in separate structures

All versions of Hack and NetHack prior to NetHack 3.0.0 have various monster description structures floating around in their source code, for monsters with special functions. These are listed here, with monsters having the same function in the same row. The large dog appears both here and in the above table because the structure in the above table is used for wild dogs, and the one shown below is used for pets. In Hack 1.0, the shopkeeper is moved to the main monster list.

Hack121 PDP-11 Hack Hack 1.0
vampire bat (b)
shopkeep (☺) shopkeeper (@) in main monster table
guard (☺) treasurer (@) guard (@)
little dog (d) little dog (d)
dog (d) dog (d)
large dog (d) large dog (d)
giant eel (;)
ghost (tab)

The character for the ghost is coded as a tab character, or '\t'. This is likely to be a bug or an arcane hack.

The giant eel appears in essentially its modern form. The current version of AEB Hack at the release of the PDP-11 Hack was 1.0.1, and this version did not have giant eels. Giant eels do appear in Hack 1.0.2, and the source code credits the publishers of PDP-11 Hack, Michiel Huisjes and Fred de Wilde, for the inspiration. That credit is still present in NetHack 3.4.3[5].

Available Objects

Hack121, PDP-11 Hack, and Hack 1.0 show many similarities in their object lists. Except as noted, the object lists are presented in the order in which they occur in the code. PC/IX Hack is the same as PDP-11 Hack except as otherwise noted.

Armor

In Hack121, the only armor types available are suits of armor and shields; PDP-11 Hack implements suits of armor and an elven cloak. Hack 1.0 adds a helmet, a shield, and a pair of gloves, allowing five pieces of armor to be worn at the same time. All armor is worn or removed using the same command.

The list of hack121 suits is reordered here to match the PDP-11 and Hack 1.0 orders:

Hack121 PDP-11 Hack 1.0
helmet
plate mail plate mail plate mail
splint mail splint mail splint mail
banded mail banded mail
chain mail chain mail chain mail
scale mail scale mail scale mail
ring mail ring mail ring mail
studded leather armor studded leather armor
leather armor leather armor leather armor
elven cloak elven cloak
elfin chain mail
(not armor) shield
pair of gloves

Food

The available food items are as follows:

Hack121 PDP-11 Hack 1.0
food ration food ration food ration
tripe ration tripe ration tripe ration
beef jerky pancake pancake
dead lizard dead lizard dead lizard
steak cookie fortune cookie
carrot
tin
orange orange orange
apple apple apple
pear pear pear
melon melon
banana banana banana
spinach candy bar candy bar
egg egg egg
clove of garlic
corpse

Both spinach and steak may randomly increase strength in hack121.

The dead lizard has no special properties in hack121 or Hack PDP-11, and is simply an item of food. In Hack 1.0, it can relieve confusion, but has no effect on cockatrices: stoning by cockatrice hissing is an instadeath in all three of these versions of Hack.

Weapons

Hack121 and Hack for PDP-11 offer the same set of weapons. Hack 1.0 adds a few to these:

hack121 PDP-11 Hack 1.0
arrow arrow arrow
sling bullet sling bullet sling bullet
crossbow bolt crossbow bolt crossbow bolt
dart dart dart
rock
boomerang
mace mace mace
axe axe axe
flail flail flail
long sword long sword long sword
two handed sword two handed sword two handed sword
dagger dagger dagger
worm tooth
crysknife
spear spear spear
bow bow bow
sling sling sling
crossbow crossbow crossbow

Potions

Several potions in Hack121 have disappeared in later versions. Hack 1.0 adds one potion over PDP-11.

Hack121 PDP-11 PC/IX Hack 1.0
restore strength restore strength restore strength restore strength
alcohol booze confuse monster booze
second sight
forgetfulness
extra hit points
invisibility invisibility invisibility invisibility
fruit juice fruit juice fruit juice fruit juice
healing healing healing healing
paralysis paralysis paralysis paralysis
monster detection monster detection monster detection
object detection object detection object detection object detection
poison sickness sickness sickness
confusion confusion confusion confusion
potion of gain strength gain strength gain strength
speed speed speed speed
blindness blindness blindness blindness
gain level gain level gain level gain level
extra healing extra healing extra healing extra healing
levitation

‡ Hack for PDP-11 replaced the scroll of confuse monster with a scroll of losing. The porters to PC/IX reinstated the former as a potion.

Scrolls

Available scrolls are as follows. The Hack121 list is ordered in an attempt to match the other two.

hack121 PDP11 Hack 1.0
enchant armor enchant armor enchant armor
(different location) (different location) destroy armor
confuse monster losing confuse monster
destroy monsters
scare monsters curse levels scare monster
ressurection [sic]
blank paper
remove curse remove curse remove curse
enchant weapon enchant weapon enchant weapon
create monster create monster damage weapon
damage weapon damage weapon create monster
taming
genocide genocide genocide
rust armor destroy armor (different location)
light light light
teleportation transportation teleportation
gold detection gold detection gold detection
food detection
identify identify identify
magic mapping magic mapping magic mapping
amnesia
fire fire fire
punishment
charge wand

For PDP-11:

  • The "scroll of losing" takes away the hero's entire inventory and scatters it about the level. It is noted in source code comments as replacing the scroll of confuse monster.
  • The "scroll of curse levels" appears to curse the hero himself, causing shopkeepers to be angry and all picked-up items to become cursed. The scroll of remove curse will rescind this effect, and in these versions it is not itself affected by curses.
  • The scroll of transportation, as well as teleporting, functions as an elevator. The code carries the notice "Extended by Michiel and Fred: One can jump between levels".

Wands

Available wands are as follows. The Hack121 list is reordered in an attempt to match the other two:

Hack121 PDP-11 Hack 1.0
light light light
trap detection secret door + trap detection secret door detection
create monster create monster create monster
wishing
wonder
striking exhaustion striking
slow monster slow monster slow monster
speed monster speed monster speed monster
undead turning undead turning
polymorph polymorph polymorph
frighten monster
cancellation cancellation cancellation
teleport monster teleport monster teleport monster
make invisible
digging digging digging
monster invisibility
magic missile magic missile magic missile
fire fire fire
sleep sleep sleep
cold cold cold
death death death
confusion
door closing

In Hack121, the wand of wonder is a random wand of another type which changes each time you zap it. In D&D, a wand of wonder works as a random wand of another type.

Note: In iLarn (and in ULarn), a wand of wonder prevents the player from falling down holes when in the main inventory. It could serve the same purpose here, as this would not be very apparent to most players.

Rings

Available rings are as follows. For hack121, the order has been changed to match the other two versions.

Hack121 PDP-11 Hack 1.0
adornment adornment adornment
teleportation teleportation teleportation
regeneration regeneration regeneration
searching searching searching
see invisible see invisible see invisible
stealth stealth stealth
floating levitation
poison resistance poison resistance poison resistance
aggravate monster aggravate monster aggravate monster
hunger hunger hunger
monster creation
berzerking
another chance
fire and cold resistance fire resistance fire resistance
cold resistance cold resistance
protection from magic protection from shape-changers protection from shape changers
conflict
gain strength gain strength gain strength
increase damage increase damage increase damage
protection protection protection
increase hit points
warning
teleport control

It is uncertain if the hack121 ring of protection from magic has any connection to the ring of protection from shape changers in the other versions.

Gems

Hack121 appears to have gems, but their function is uncertain. In Hack for PDP-11, they only add to the player's score; neither of these Hacks has unicorns. Hack 1.0 has gems in their modern form.

Other objects

The remaining objects in each game seem to have no connection to each other. Hack121 has these objects:

Hack for PDP-11 only has the "amulet of Frobozz", which may be the forerunner of the Amulet of Yendor.

Hack 1.0 has these objects:

References

  1. Fenlason Hack source tree, GitHub repository preserved by Dan Stormont, accessed 3 February 2026.
  2. Brian Harvey, “Computer Hacking and Ethics: The Lincoln-Sudbury Case Study”, ACM Select Panel on Hacking, 1985.
  3. *;login:* Vol. 7, No. 3 (June 1982), USENIX Association.
  4. On The Train Of Life With NetHack’s Papa, Julie Bresnick, Linux.com, 2000.
  5. mkroom.c in NetHack 3.4.3, line 447