vak: (Default)
[personal profile] vak
Игра Hunt the Wumpus (1972) положила начало всем пошаговым бродилкам и стрелялкам, от "Пещеры" и "Рогаликов" до "Dungeon" и "dnd". Здесь впервые появились комнаты, между которыми можно перемещаться, и злыдни, в которых следует стрелять.

Прикол ещё и в том, что пространство здесь не привычная квадратная сетка, а ребра додекаэдра. Всего 20 комнат, и из каждой есть переход в три соседние. Вроде бы симметрично и несложно, но в голове удерживать не получается. 😀

Игра была написана на Бейсике, но к счастью, есть современная реплика на Си. Скачиваем, компилируем, запускаем. Мне даже с первого раза удалось поразить Вампуса на втором ходу.
$ git clone https://gitlab.com/esr/wumpus.git
$ cd wumpus
$ make
cc -Wall wumpus.c -o wumpus
cc -Wall superhack.c -o superhack
$ ./wumpus
INSTRUCTIONS (Y-N)
?y
WELCOME TO 'HUNT THE WUMPUS'
  THE WUMPUS LIVES IN A CAVE OF 20 ROOMS. EACH ROOM
HAS 3 TUNNELS LEADING TO OTHER ROOMS. (LOOK AT A
DODECAHEDRON TO SEE HOW THIS WORKS-IF YOU DON'T KNOW
WHAT A DODECAHEDRON IS, ASK SOMEONE)

     HAZARDS:
 BOTTOMLESS PITS - TWO ROOMS HAVE BOTTOMLESS PITS IN THEM
     IF YOU GO THERE, YOU FALL INTO THE PIT (& LOSE!)
 SUPER BATS - TWO OTHER ROOMS HAVE SUPER BATS. IF YOU
     GO THERE, A BAT GRABS YOU AND TAKES YOU TO SOME OTHER
     ROOM AT RANDOM. (WHICH MAY BE TROUBLESOME)
TYPE AN E THEN RETURN 
?e
     WUMPUS:
 THE WUMPUS IS NOT BOTHERED BY HAZARDS (HE HAS SUCKER
 FEET AND IS TOO BIG FOR A BAT TO LIFT).  USUALLY
 HE IS ASLEEP.  TWO THINGS WAKE HIM UP: YOU SHOOTING AN
ARROW OR YOU ENTERING HIS ROOM.
     IF THE WUMPUS WAKES HE MOVES (P=.75) ONE ROOM
 OR STAYS STILL (P=.25).  AFTER THAT, IF HE IS WHERE YOU
 ARE, HE EATS YOU UP AND YOU LOSE!

     YOU:
 EACH TURN YOU MAY MOVE OR SHOOT A CROOKED ARROW
   MOVING:  YOU CAN MOVE ONE ROOM (THRU ONE TUNNEL)
   ARROWS:  YOU HAVE 5 ARROWS.  YOU LOSE WHEN YOU RUN OUT
   EACH ARROW CAN GO FROM 1 TO 5 ROOMS. YOU AIM BY TELLING
   THE COMPUTER THE ROOM#S YOU WANT THE ARROW TO GO TO.
   IF THE ARROW CAN'T GO THAT WAY (IF NO TUNNEL) IT MOVES
   AT RANDOM TO THE NEXT ROOM.
     IF THE ARROW HITS THE WUMPUS, YOU WIN.
     IF THE ARROW HITS YOU, YOU LOSE.
TYPE AN E THEN RETURN 
?e
    WARNINGS:
     WHEN YOU ARE ONE ROOM AWAY FROM A WUMPUS OR HAZARD,
     THE COMPUTER SAYS:
 WUMPUS:  'I SMELL A WUMPUS'
 BAT   :  'BATS NEARBY'
 PIT   :  'I FEEL A DRAFT'

HUNT THE WUMPUS

I SMELL A WUMPUS!
YOU ARE IN ROOM 6
TUNNELS LEAD TO 5 7 15

SHOOT OR MOVE (S-M)
?m
WHERE TO
?7
... OOPS! BUMPED A WUMPUS!

I SMELL A WUMPUS!
I FEEL A DRAFT
YOU ARE IN ROOM 7
TUNNELS LEAD TO 6 8 17

SHOOT OR MOVE (S-M)
?s
NO. OF ROOMS (1-5)
?2
ROOM #
?8
ROOM #
?17
AHA! YOU GOT THE WUMPUS!
HEE HEE HEE - THE WUMPUS'LL GET YOU NEXT TIME!!
Заметьте, что по команде make в этом репозитории скомпилировалась ещё одна игра: superhack. Суть похожая, но несколько другая история:
$ ./superhack
Hunt the Superhack
You are in room 19.  Exits lead to 11, 18, 20.  You have 5 pies left.
Droids nearby!
Throw, move or help [t,m,?]? ?
Welcome to `Hunt the Superhack'

   The superhack lives on the 9th floor of 45 Technology Square in
Cambridge, Massachusetts.  Your mission is to throw a pie in his face.

   First, you'll have to find him.  A botched experiment by an MIT
physics group has regularized the floor's topology, so that each
room has exits to three other rooms.  (Look at a dodecahedron to
see how this works --- if you don't know what a dodecahedron is,
ask someone.)

You:
   Each turn you may move to an adjacent room or throw a pie.  If
you run out of pies, you lose.  Each pie can pass through up to
five rooms (connected by a continuous path from where you are).  You
aim by telling the computer which rooms you want to throw through.
If the path is incorrect (presumes a nonexistent connection) the 
pie moves at random.
   If a pie hits the superhack, you win. If it hits you, you lose!

<Press return to continue>

Hazards:
   Starlets --- two rooms contain lonely, beautiful women.  If you
enter these, you will become fascinated and forget your mission as
you engage in futile efforts to pick one up.  You weenie.
   Droids --- two rooms are guarded by experimental AI security 
droids.  If you enter either, the droid will grab you and hustle
you off to somewhere else, at random.
   Lusers --- two rooms contain hungry lusers.  If you blunder into
either, they will eat one of your pies.
   Superhack --- the superhack is not bothered by hazards (the
lusers are in awe of him, he's programmed the droids to ignore him,
and he has no sex life).  Usually he is hacking.  Two things can
interrupt him; you throwing a pie or you entering his room.

   On an interrupt, the superhack moves (3/4 chance) or stays where
he is (1/4 chance).  After that, if he is where you are, he flames
you and you lose!

<Press return to continue>

Warnings:
   When you are one room away from the superhack or a hazard,
the computer says:
   superhack:       "I smell a superhack!"
   security droid:  "Droids nearby!"
   starlet:         "I smell perfume!"
   luser:           "Lusers nearby!"
If you take too long finding the superhack, hazards may move.  You
will get a warning when this happens.

Commands:
   Available commands are:

  ?            --- print long instructions.
  m <number>   --- move to room with given number.
  t <numbers>  --- throw through given rooms.

The list of room numbers after t must be space-separated.  Anything
other than one of these commands displays a short help message.

You are in room 19.  Exits lead to 11, 18, 20.  You have 5 pies left.
Droids nearby!
Throw, move or help [t,m,?]? _

Date: 2023-07-13 08:30 (UTC)
sab123: (Default)
From: [personal profile] sab123
Мне, кстати, на эту тему недавно показали игру в виртуальной реальности под названием Demeo. Нарисовано красиво, и игра прикольная.