Home
Explore games
Help
Log in
Playfic is now in read-only mode.
You can still play existing games, but new signups and game editing is disabled.
Read the announcement.
Log in
Username
Password (
Forgot it?
)
Login
Mini Inform (Beta)
by
Nolan
Played 3,360 times
View game source
(spoilers!)
Download the
.z8 file
Source Code
"Mini Inform" Include (- [ KeyPause i; i = VM_KeyChar(); rfalse; ]; [ SPACEPause i; while (i ~= 13 or 31 or 32) { i = VM_KeyChar(); } ]; [ GetKey i; i = VM_KeyChar(); return i; ]; -) To clear the/-- screen: (- VM_ClearScreen(0); -) To clear only the/-- main screen: (- VM_ClearScreen(2); -) To clear only the/-- status line: (- VM_ClearScreen(1); -). To wait for any key: (- KeyPause(); -) To wait for the/-- SPACE key: (- SPACEPause(); -) To decide what number is the chosen letter: (- GetKey() -) To pause the/-- game: say "[paragraph break]Please press SPACE to continue."; wait for the SPACE key; clear the screen. To center (quote - text): (- CenterPrintComplex({quote}); -); To center (quote - text) at the/-- row (depth - a number): (- CenterPrint({quote}, {depth}); -); To stop the/-- game abruptly: (- quit; -) To show the/-- current quotation: (- ClearBoxedText(); -); Include (- #ifndef printed_text; Array printed_text --> 64; #endif; [ CenterPrint str depth i j; font off; i = VM_ScreenWidth(); VM_PrintToBuffer(printed_text, 63, str); j = (i-(printed_text-->0))/2; j = j-1; VM_MoveCursorInStatusLine(depth, j); print (I7_string) str; font on; ]; [ CenterPrintComplex str i j; font off; print "^"; i = VM_ScreenWidth(); VM_PrintToBuffer(printed_text, 63, str); j = (i-(printed_text-->0))/2; spaces j-1; print (I7_string) str; font on; ]; -) To decide what number is screen width: (- VM_ScreenWidth() -); To decide what number is screen height: (- I7ScreenHeight() -); Include (- [ I7ScreenHeight i screen_height; i = 0->32; if (screen_height == 0 or 255) screen_height = 18; screen_height = screen_height - 7; return screen_height; ]; -) To deepen the/-- status line to (depth - a number) rows: (- DeepStatus({depth}); -); To move the/-- cursor to (depth - a number): (- I7VM_MoveCursorInStatusLine({depth}); -) To right align the/-- cursor to (depth - a number): (- RightAlign({depth}); -) Include (- [ DeepStatus depth i screen_width; VM_StatusLineHeight(depth); screen_width = VM_ScreenWidth(); #ifdef TARGET_GLULX; VM_ClearScreen(1); #ifnot; style reverse; for (i=1:i<depth+1:i++) { @set_cursor i 1; spaces(screen_width); } #endif; ]; [ I7VM_MoveCursorInStatusLine depth; VM_MoveCursorInStatusLine(depth, 1); ]; [ RightAlign depth screen_width o n; screen_width = VM_ScreenWidth(); n = (+ right alignment depth +); o = screen_width - n; VM_MoveCursorInStatusLine(depth, o); ]; -) Table of Ordinary Status left central right "[location]" "" "[score]/[turn count]" Status bar table is a table-name that varies. Status bar table is the Table of Ordinary Status. To fill the/-- status bar/line with (selected table - a table-name): let __n be the number of rows in the selected table; deepen status line to __n rows; let __index be 1; repeat through selected table begin; move cursor to __index; say "[left entry]"; center central entry at row __index; right align cursor to __index; say "[right entry]"; increase __index by 1; end repeat. Right alignment depth is a number that varies. Right alignment depth is 14. To say default letters: (- @set_colour 1 1; -) To say red letters: (- @set_colour 3 0; -) To say green letters: (- @set_colour 4 0; -) To say yellow letters: (- @set_colour 5 0; -) To say blue letters: (- @set_colour 6 0; -) To say magenta letters: (- @set_colour 7 0; -) To say cyan letters: (- @set_colour 8 0; -) To say white letters: (- @set_colour 9 0; -) To say black letters: (- @set_colour 2 0; -) To turn the/-- background black: (- @set_colour 0 2; -); To turn the/-- background red: (- @set_colour 0 3; -); To turn the/-- background green: (- @set_colour 0 4; -); To turn the/-- background yellow: (- @set_colour 0 5; -); To turn the/-- background blue: (- @set_colour 0 6; -); To turn the/-- background magenta: (- @set_colour 0 7; -); To turn the/-- background cyan: (- @set_colour 0 8; -); To turn the/-- background white: (- @set_colour 0 9; -); The display banner rule is not listed in the startup rulebook. MINI_INFORM is a room. Runtime Room is a room. The printed name of Runtime Room is "Untitled Room". There are 5 things. There are 5 containers. There are 5 supporters. There are 5 men. There are 5 women. There are 5 animals. Definition: a thing is non-container if it is not a container. Definition: a thing is non-supporter if it is not a supporter. Definition: a thing is non-person if it is not a person. Definition: a thing is non-animal if it is not an animal. Definition: a thing is non-container if it is not a container. At runtime is a truth state variable. At runtime is false. At programming startup is a truth state variable. At programming startup is true. When play begins: now the command prompt is ":: "; now the left hand status line is ""; now the right hand status line is ""; Before doing something other than playing or asking for info or setting the starting room name or introducing a thing or introducing a container or introducing a supporter or introducing a man or introducing a woman or introducing an animal while at runtime is false: say "[if at programming startup is true][bold type]THIS IS THE PROGRAMMING EDITOR. TO SEE THE LIST OF COMMANDS, TYPE 'INFO'.[roman type][paragraph break][otherwise]YOU CANNOT DO THAT WHILE IN PROGRAMMING MODE. TO SEE THE LIST OF COMMANDS, TYPE 'INFO'.[end if]"; now at programming startup is false; stop; Rule for printing a parser error when the latest parser error is the not a verb I recognise error and at runtime is false: say "THAT IS NOT A MINI INFORM COMMAND. TO SEE THE LIST OF COMMANDS, TYPE 'INFO'." instead. Rule for printing a parser error when the latest parser error is the didn't understand error and at runtime is false: say "THAT IS NOT A MINI INFORM COMMAND. TO SEE THE LIST OF COMMANDS, TYPE 'INFO'." instead. Rule for printing a parser error when the latest parser error is the can't see any such thing error and at runtime is false: say "YOU CANNOT DO THAT WHILE IN PROGRAMMING MODE. TO SEE THE LIST OF COMMANDS, TYPE 'INFO'." instead. Rule for printing a parser error when the latest parser error is the only understood as far as error and at runtime is false: say "YOU CANNOT DO THAT WHILE IN PROGRAMMING MODE. TO SEE THE LIST OF COMMANDS, TYPE 'INFO'." instead. Rule for printing a parser error when the latest parser error is the I beg your pardon error and at runtime is false: say "IF YOU ARE LOST, TYPE 'INFO' TO SEE THE LIST OF COMMANDS." instead. Understand "the player" or "player" as yourself while at runtime is false. Understand "INFO" or "HELP" as asking for info. Asking for info is an action applying to nothing. Check asking for info (this is the only ask for info at programming rule): if at runtime is true: say "That's not a verb I recognise."; now turn count is turn count - 1; stop the action; Report asking for info (this is the list programming commands rule): say "[bold type] :: CALL STARTING ROOM (TEXT)[roman type] LETS YOU NAME THE ROOM TO START IN.[line break]"; say "[bold type] :: INTRODUCE (KIND) CALLED (TEXT)[roman type] LETS YOU CREATE A NEW THING, CONTAINER, SUPPORTER, MAN, WOMAN OR ANIMAL. (PLEASE DO NOT USE ARTICLES LIKE 'A', 'AN', 'THE', 'SOME', ETC. WHILE INTRODUCING)[line break]"; say "[bold type] :: UNDO[roman type] LETS YOU UNDO THE LAST THING YOU HAVE DONE.[line break]"; say "[bold type] :: PLAY[roman type] LETS YOU PLAY YOUR GAME.[line break]"; say "[bold type] >quit[roman type] BRINGS YOU BACK INTO THE EDITOR.[line break]"; Start room name is an indexed text variable. Start room name is "Untitled Room". Start room description is an indexed text variable. Start room description is "". Understand "CALL STARTING ROOM [text]" as setting the starting room name. Setting the starting room name is an action applying to one topic. Check setting the starting room name (this is the only set the starting room name at programming rule): if at runtime is true: say "That's not a verb I recognise."; now turn count is turn count - 1; stop the action; Carry out setting the starting room name (this is the set the starting room name rule): now start room name is "[the topic understood]"; now the printed name of Runtime Room is "[start room name]"; Report setting the starting room name (this is the report setting the starting room name rule): say "THE STARTING ROOM IS NOW CALLED '[start room name]'."; A thing has some indexed text called the creation name. The creation name of a thing is usually "". Understand the creation name property as describing a thing. Understand "INTRODUCE THING CALLED [text]" or "INTRODUCE A THING CALLED [text]" or "INTRODUCE THE THING CALLED [text]" as introducing a thing. Introducing a thing is an action applying to one topic. Check introducing a thing (this is the only introduce a thing at programming rule): if at runtime is true: say "That's not a verb I recognise."; now turn count is turn count - 1; stop the action; Carry out introducing a thing (this is the introduce a thing rule): let L be a random off-stage non-container non-supporter non-person non-animal thing; if L is a thing: repeat with M running through things: if the creation name of M is the topic understood: say "THERE IS ALREADY SOMETHING OR SOMEONE CALLED '[M]'."; now turn count is turn count - 1; stop the action; now the creation name of L is the topic understood; now the printed name of L is "[the creation name]"; now L is in Runtime Room; say "YOU HAVE INTRODUCED A THING CALLED '[L]' INTO THE STARTING ROOM."; otherwise: say "YOU MAY ONLY INTRODUCE UP TO 5 OF EACH KIND. IF YOU WOULD LIKE TO START OVER, RELOAD THE PAGE."; now turn count is turn count - 1; stop the action; Understand "INTRODUCE CONTAINER CALLED [text]" or "INTRODUCE A CONTAINER CALLED [text]" or "INTRODUCE THE CONTAINER CALLED [text]" as introducing a container. Introducing a container is an action applying to one topic. Check introducing a container (this is the only introduce a container at programming rule): if at runtime is true: say "That's not a verb I recognise."; now turn count is turn count - 1; stop the action; Carry out introducing a container (this is the introduce a container rule): let L be a random off-stage container; if L is a container: repeat with M running through things: if the creation name of M is the topic understood: say "THERE IS ALREADY SOMETHING OR SOMEONE CALLED '[M]'."; now turn count is turn count - 1; stop the action; now the creation name of L is the topic understood; now the printed name of L is "[the creation name]"; now L is in Runtime Room; say "YOU HAVE INTRODUCED A CONTAINER CALLED '[L]' INTO THE STARTING ROOM."; otherwise: say "YOU MAY ONLY INTRODUCE UP TO 5 OF EACH KIND. IF YOU WOULD LIKE TO START OVER, RELOAD THE PAGE."; now turn count is turn count - 1; stop the action; Understand "INTRODUCE SUPPORTER CALLED [text]" or "INTRODUCE A SUPPORTER CALLED [text]" or "INTRODUCE THE SUPPORTER CALLED [text]" as introducing a supporter. Introducing a supporter is an action applying to one topic. Check introducing a supporter (this is the only introduce a supporter at programming rule): if at runtime is true: say "That's not a verb I recognise."; now turn count is turn count - 1; stop the action; Carry out introducing a supporter (this is the introduce a supporter rule): let L be a random off-stage supporter; if L is a supporter: repeat with M running through things: if the creation name of M is the topic understood: say "THERE IS ALREADY SOMETHING OR SOMEONE CALLED '[M]'."; now turn count is turn count - 1; stop the action; now the creation name of L is the topic understood; now the printed name of L is "[the creation name]"; now L is in Runtime Room; say "YOU HAVE INTRODUCED A SUPPORTER CALLED '[L]' INTO THE STARTING ROOM."; otherwise: say "YOU MAY ONLY INTRODUCE UP TO 5 OF EACH KIND. IF YOU WOULD LIKE TO START OVER, RELOAD THE PAGE."; now turn count is turn count - 1; stop the action; Understand "INTRODUCE MAN CALLED [text]" or "INTRODUCE A MAN CALLED [text]" or "INTRODUCE THE MAN CALLED [text]" as introducing a man. Introducing a man is an action applying to one topic. Check introducing a man (this is the only introduce a man at programming rule): if at runtime is true: say "That's not a verb I recognise."; now turn count is turn count - 1; stop the action; Carry out introducing a man (this is the introduce a man rule): let L be a random off-stage man; if L is a man: repeat with M running through things: if the creation name of M is the topic understood: say "THERE IS ALREADY SOMETHING OR SOMEONE CALLED '[M]'."; now turn count is turn count - 1; stop the action; now the creation name of L is the topic understood; now the printed name of L is "[the creation name]"; now L is in Runtime Room; say "YOU HAVE INTRODUCED A MAN CALLED '[L]' INTO THE STARTING ROOM."; otherwise: say "YOU MAY ONLY INTRODUCE UP TO 5 OF EACH KIND. IF YOU WOULD LIKE TO START OVER, RELOAD THE PAGE."; now turn count is turn count - 1; stop the action; Understand "INTRODUCE WOMAN CALLED [text]" or "INTRODUCE A WOMAN CALLED [text]" or "INTRODUCE THE WOMAN CALLED [text]" as introducing a woman. Introducing a woman is an action applying to one topic. Check introducing a woman (this is the only introduce a woman at programming rule): if at runtime is true: say "That's not a verb I recognise."; now turn count is turn count - 1; stop the action; Carry out introducing a woman (this is the introduce a woman rule): let L be a random off-stage woman; if L is a woman: repeat with M running through things: if the creation name of M is the topic understood: say "THERE IS ALREADY SOMETHING OR SOMEONE CALLED '[M]'."; now turn count is turn count - 1; stop the action; now the creation name of L is the topic understood; now the printed name of L is "[the creation name]"; now L is in Runtime Room; say "YOU HAVE INTRODUCED A WOMAN CALLED '[L]' INTO THE STARTING ROOM."; otherwise: say "YOU MAY ONLY INTRODUCE UP TO 5 OF EACH KIND. IF YOU WOULD LIKE TO START OVER, RELOAD THE PAGE."; now turn count is turn count - 1; stop the action; Understand "INTRODUCE ANIMAL CALLED [text]" or "INTRODUCE AN ANIMAL CALLED [text]" or "INTRODUCE THE ANIMAL CALLED [text]" as introducing an animal. Introducing an animal is an action applying to one topic. Check introducing an animal (this is the only introduce an animal at programming rule): if at runtime is true: say "That's not a verb I recognise."; now turn count is turn count - 1; stop the action; Carry out introducing an animal (this is the introduce an animal rule): let L be a random off-stage animal; if L is an animal: repeat with M running through things: if the creation name of M is the topic understood: say "THERE IS ALREADY SOMETHING OR SOMEONE CALLED '[M]'."; now turn count is turn count - 1; stop the action; now the creation name of L is the topic understood; now the printed name of L is "[the creation name]"; now L is in Runtime Room; say "YOU HAVE INTRODUCED AN ANIMAL CALLED '[L]' INTO THE STARTING ROOM."; otherwise: say "YOU MAY ONLY INTRODUCE UP TO 5 OF EACH KIND. IF YOU WOULD LIKE TO START OVER, RELOAD THE PAGE."; now turn count is turn count - 1; stop the action; Understand "PLAY" as playing. Playing is an action applying to nothing. Check playing (this is the only play at programming rule): if at runtime is true: say "That's not a verb I recognise."; now turn count is turn count - 1; stop the action; Carry out playing (this is the play rule): now at runtime is true; now the turn count is 0; now the command prompt is ">"; now the left hand status line is "[location]"; now the right hand status line is "[score]/[turn count]"; now the player is in Runtime Room; First check quitting the game: say "WELCOME BACK TO MINI_INFORM EDITOR."; now at runtime is false; now the command prompt is ":: "; now the left hand status line is ""; now the right hand status line is ""; now at programming startup is true; now the player is in MINI_INFORM; stop the action;