# A Void # by Gorgs Prc # # Adaptation to IF by log # ------------------ # Variables # ------------------ import random import os from time import sleep import sys import voidfunc rooms = ["room", "island", "bar"] roomthings = {} roomthings["room"]={"bookstand": "To his right is a mahogany stand on which sit 26 books - on which, I should say, 26 books normally ought to sit, but, as always, a book is missing, a book with an inscription, '5', on its flap. Nothing about this stand, though, looks at all abnormal or out of proportion, no hint of a missing publication, no filing card or 'ghost', as librarians quaintly call it, no conspicuous gap or blank", "windowsill": "Crawling across his windowsill is a tiny animal, indigo and saffron in colour, not a cockroach, not a blowfly, but a kind of wasp, laboriously dragging a sugar crumb along with it. Hoping to crush it with a casual blow, Vowl lifts up his right hand; but it abruptly flaps its wings, flying off without giving its assailant an opportunity to do it any harm.", "door": "Padding into his bathroom, Vowl dabs at his brow and throat with a damp cloth. Back to his room.", "visiting-card": "Laid out languorously, all day long, on a couch or on a sofa, or on occasion rocking to and fro in his rocking chair, stubbornly trying to copy out on an old visiting-card that indistinct motif that had sprung at him from his rug, as frail as an infant but not now, thanks to Cochin's surgical skills, in all that much physical pain, our protagonist starts hallucinating, blowing his mind. ", "rug": "His mind runs riot. Lost in thought, scrutinising his rug, Vowl starts imagining 5, 6, 26 distinct visual combinations, absorbing but also insubstantial, as though an artist's rough drafts but of what? - that, possibly, which a psychiatrist would call Jungian slips, an infinity of dark, mythic, anonymous portraits flitting through his brain, as it burrows for a solitary, global signal that might satisfy his natural human lust for signification both instant and lasting, a signal that might commandingly stand out from this chain of discontinuous links, this miasma of shadowy tracings, all of which, or so you would think, ought to knit up to form a kind of paradigmatic configuration, of which such partial motifs can furnish only anagrams and insipid approximations: \n a body crumpling up, a hoodlum, a portrait of an artist as a young dog; \n a bullock, a Bogartian falcon, a brooding blackbird; \n an arthritic old man; \n a sigh;"} roomthings["island"]={ "stick": "At dusk, using a sharp rock, Ishmail cuts a notch on a stick (to tick off his first night as a castaway); and, with a total of 20 such cuts, constructs a hut, a sort of impromptu shack, with a door, four walls, and flooring and roofing built out of mud. With no matchsticks at hand, though, his food is invariably raw.", "compound": "It was built, circa 1930, in a crypto-rococo fashion imitating, variously, a pink-icing casino in Monaco, a bungalow on a Malayan plantation, a colonialist villa, an ultra-chic condominium in Miami and Tara from GWTW. ", "cushion": " a numb, downcast, haggard Ishmail withdraws his hand. What, again, occurs is that this cushion, say - a thing normally as soft and downy as a baby's bottom - is, to his touch, now a hard, cold, compact block, as rock-hard as a diamond, as though part of a shadowy twin world consubstantial with Ishmail's own but caught through a glass darkly, a living mirror of our own world and just as cold, shiny and insular as a mirror. "} roomthings["bar"]={ "barman": """BARMAN (who knows a thing or two): Morning, mon Commandant. COMMANDANT (calming down now that, although in mufti, his rank is plain to this barman): Ah, good morning to you, my boy, good morning! BARMAN (who has a slight but distinct hint of Oirishry about him): And what, pray, can I do for you, sir? Your wish is my command. COMMANDANT (licking his lips): You know what I fancy most of all - a port-flip. BARMAN (frowning)-. What? """, "port": """COMMANDANT (furiously pointing in front of him): Now look, that's port, isn't it? BARMAN (in agony): Uh huh . . . but. . . COMMANDANT (livid): So? So? And (pointing again) that's an. . . """} bag = ["watch"] message ={ "room": """ Incurably insomniac, Anton Vowl turns on a light. According to his watch it's only 12.20. With a loud and languorous sigh Vowl sits up, stuffs a pillow at his back, draws his quilt up around his chin, picks up his whodunit and idly scans a paragraph or two; but, judging its plot impossibly difficult to follow in his condition, its vocabulary too whimsically multisyllabic for comfort, throws it away in disgust. """, "island": """ But six days go past, and his unusually robust constitution allows him finally to sit up and look around him. Our protagonist is now disturbingly skinny but can still, if with difficulty, climb out of his pit — a pit that was almost his tomb. So Ishmail starts living again.""", "bar": """ MAN, sitting down and barking (with gruff and, as you might say, military incivility): Barman! """} death ={ "room": """ It's all in vain. His subconscious vision starts buzzing around him again, buzzing around and within him, choking and suffocating him.""", "island": """ At which point Ishmail falls victim to hallucinations, possibly from consuming a poisonous black mushroom or having had too much to drink; or, why not, from having shrunk so much as to vanish wholly from sight""", "bar": """BARMAN (abruptly dying): Aaaaaaah! Shhhhhhh . . . R.I.P. COMMANDANT (about to go but first noticing his body): What a storm in a port-flip! Which is what you might call adding insult to injury.""",} intro ={ "room":"""1 Which at first calls to mind a probably familiar story of a drunk man waking up with his brain in a whirl.""", "island":"""2 In which luck, God's alias and alibi, plays a callous trick on a suitor cast away on an island.""", "bar": """3 "Oh, how idiotic," murmurs Vowl. But just as idiotic, now, is his vision of a man going into a bar: """} class bcolors: BLUE = '\033[94m' CYAN = '\033[96m' GREEN = '\033[92m' YELLOW = '\033[93m' RED = '\033[91m' MAGENTA = '\x1b[35m' ENDC = '\033[0m' BOLD = '\033[1m' UNDERLINE = '\033[4m' # Start of book # ------------------ os.system('clear') #this needs to be cls for windows print(bcolors.CYAN + "-"*80 + "\n" + "-"*80 + "\n" + "-"*80 + "\n") sleep(0.5) print(""" _ _ __ _ __ _____ (_) __| | / _` | \ \ / / _ \| |/ _` | | (_| | \ V / (_) | | (_| | \__,_| \_/ \___/|_|\__,_| by Gorgs Prc Push ↵ to start """) sleep(0.5) print("-"*80 + "\n" + "-"*80 + "\n" + "-"*80 + "\n" + bcolors.ENDC) input() os.system('clear') #this needs to be cls for windows sleep(1) print(bcolors.CYAN + "-"*80 + """ ::: :+:+: +:+ +#+ +#+ #+# ####### _ _ _ _ _ _ _ _ _ / \ / \ / \ / \ / \ / \ / \ / \ / \ ( A | n | t | o | n ) ( V | o | w | l ) \_/ \_/ \_/ \_/ \_/ \_/ \_/ \_/ \_/ """) print("-"*80) sleep(1) voidfunc.delayPrint("\n" + " "*40 + intro[voidfunc.current_room]) print("-"*79 + bcolors.ENDC) sleep(1) voidfunc.delayPrint(message[voidfunc.current_room]) while True: # Wait for user input reply = input() # End the game if all rooms have been explored if len(rooms) == 0: voidfunc.gameover() break # End the room if all items have been interacted with if any(s not in voidfunc.viewedthings for s in roomthings[voidfunc.current_room]): pass else: voidfunc.nextroom(death,rooms,intro,message) # Do functions based on reply if "exit" in reply: voidfunc.gameover() break elif "e" in reply or len(roomthings[voidfunc.current_room]) == 0: voidfunc.nextroom(death,rooms,intro,message) elif "port" in reply and "flip" in reply: voidfunc.portflip(rooms) elif any(word in reply.split() for word in roomthings[voidfunc.current_room]): word = next((s for s in reply.split() if s in roomthings[voidfunc.current_room]), None) voidfunc.interact(word, roomthings) elif any(s in reply for s in ["look", "scan", "watch", "study", "spot", "spy", "analysis", "probing", "grill", voidfunc.current_room]): voidfunc.look(roomthings, voidfunc.current_room) else: voidfunc.delayPrint(voidfunc.defaultReply())