Skip to content

Commit 7bb70ad

Browse files
committed
add missing files
1 parent 5986483 commit 7bb70ad

File tree

2 files changed

+252
-0
lines changed

2 files changed

+252
-0
lines changed

bin/inf

Lines changed: 116 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,116 @@
1+
#!/bin/bash
2+
3+
# Copyright (c) 2019, 2024 Andy Kosela <akosela@andykosela.com>
4+
# All rights reserved.
5+
#
6+
# Redistribution and use in source and binary forms, with or without
7+
# modification, are permitted provided that the following conditions
8+
# are met:
9+
# 1. Redistributions of source code must retain the above copyright
10+
# notice, this list of conditions and the following disclaimer.
11+
# 2. Redistributions in binary form must reproduce the above copyright
12+
# notice, this list of conditions and the following disclaimer in
13+
# the documentation and/or other materials provided with the
14+
# distribution.
15+
#
16+
# THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS''
17+
# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
18+
# THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
19+
# PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR
20+
# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
21+
# EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
22+
# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
23+
# PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
24+
# OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
25+
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
26+
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27+
28+
inform=/usr/local/bin/inform
29+
lib=/usr/local/share/inform615/minform
30+
a8bin=/usr/local/share/inform615/bin/a8.bin
31+
v=-v3
32+
33+
replay()
34+
{
35+
bgame=`basename $game .key`
36+
if [ ! -z "`grep -e quit -e save $game`" ]; then
37+
sed -i'' '/^quit/d ; /^save/d' $game
38+
elif [ -z "`grep 'script off' $game`" ]; then
39+
echo "script off" >> $game
40+
fi
41+
42+
echo -e "0a\nscript\n$bgame.scr\n.\n\$a\nsave\n$bgame.qzl\nquit\ny\ny\n.\nw" |
43+
ed - $game
44+
45+
[ -e "$bgame.scr" ] && rm $bgame.scr
46+
[ -e "$bgame.qzl" ] && rm $bgame.qzl
47+
48+
cat $game | frotz $story 1>/dev/null 2>&1
49+
echo -e "g/^script/d\ng/^quit/d\ng/^save/d\ng/.qzl/d\ng/.scr/d\ng/^y$/d\nw" |
50+
ed - $game
51+
echo "$bgame.scr - replay transcript file"
52+
echo "$bgame.qzl - replay save file"
53+
echo "$bgame.key - replay walkthrough file"
54+
exit 0
55+
}
56+
57+
main()
58+
{
59+
$inform -d2esi $v +$lib $game
60+
bgame=`basename $game .inf`
61+
if [ ! -z $a8bin ]; then
62+
cat $a8bin $bgame.z3 > $bgame.atr 2>/dev/null
63+
size=`ls -l $bgame.atr | cut -d' ' -f5`
64+
head --bytes $((133136-$size)) /dev/zero >> $bgame.atr
65+
fi
66+
exit 0
67+
}
68+
69+
usage()
70+
{
71+
echo "usage: inf game.inf"
72+
echo " inf [-5] game.inf"
73+
echo " inf [-r] game.scr game.z3"
74+
echo " inf [-w] game.key game.z3"
75+
echo ""
76+
echo " -5 : create v5 release"
77+
echo " -r : replay game from a transcript file"
78+
echo " -w : replay game from a walkthrough file"
79+
echo ""
80+
echo "By default inf creates Z-code v3 file and Atari 8-bit atr image."
81+
exit 0
82+
}
83+
84+
# Start of script
85+
86+
if [ ! -z `echo $1 | grep '.inf'` ]; then
87+
game=$1
88+
main
89+
elif [ -z "$1" ]; then
90+
usage
91+
fi
92+
93+
while getopts 5:r:w:h opts
94+
do
95+
case $opts in
96+
5) game=$2
97+
v=-v5
98+
a8bin=""
99+
main
100+
;;
101+
r) game=$2
102+
game=`basename $game .scr`.key
103+
grep '>' $2 | cut -d'>' -f2 > $game
104+
story=$3
105+
replay
106+
;;
107+
w) game=$2
108+
story=$3
109+
replay
110+
;;
111+
h) usage
112+
;;
113+
*) usage
114+
;;
115+
esac
116+
done

inf.6

Lines changed: 136 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,136 @@
1+
.\" Copyright (c) 2019, 2024 Andy Kosela <akosela@andykosela.com>
2+
.\" All rights reserved.
3+
.\"
4+
.\" Redistribution and use in source and binary forms, with or without
5+
.\" modification, are permitted provided that the following conditions
6+
.\" are met:
7+
.\" 1. Redistributions of source code must retain the above copyright
8+
.\" notice, this list of conditions and the following disclaimer.
9+
.\" 2. Redistributions in binary form must reproduce the above copyright
10+
.\" notice, this list of conditions and the following disclaimer in
11+
.\" the documentation and/or other materials provided with the
12+
.\" distribution.
13+
.\"
14+
.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS''
15+
.\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
16+
.\" TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
17+
.\" PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR
18+
.\" CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
19+
.\" SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
20+
.\" LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
21+
.\" USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
22+
.\" ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
23+
.\" OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
24+
.\" OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
25+
.\" SUCH DAMAGE.
26+
.\"
27+
.Dd December 6, 2024
28+
.Dt INF 6
29+
.Os
30+
.Sh NAME
31+
.Nm inf
32+
.Nd Inform 6 programming language
33+
.Sh SYNOPSIS
34+
.Nm
35+
.Ar game.inf
36+
.Nm
37+
.Op Fl 5
38+
.Ar game.inf
39+
.Nm
40+
.Op Fl r
41+
.Ar game.scr game.z3
42+
.Nm
43+
.Op Fl w
44+
.Ar game.key game.z3
45+
.Nm
46+
.Op Fl h
47+
.Pp
48+
.Sh DESCRIPTION
49+
Inform is a design system for interactive fiction, created in 1993.
50+
51+
Interactive fiction is a literary form which involves programming a
52+
computer so that it presents a reader with a text which can be explored.
53+
Inform aims to make the burden of learning to program such texts as
54+
light as possible. It is a tool for writers intrigued by computing, and
55+
computer programmers intrigued by writing. Perhaps these are not so
56+
very different pursuits, in their rewards and pleasures:
57+
58+
The sheer joy of making things... the fascination of fashioning
59+
complex puzzle-like objects of interlocking moving parts and
60+
watching them work in subtle cycles... the delight of working in
61+
such a tractable medium. The programmer, like the poet, works only
62+
slightly removed from pure thought-stuff. He builds his castles in
63+
the air, from air, creating by exertion of the imagination.
64+
(Frederick P. Brooks, "The Mythical Man-Month", 1972)
65+
66+
Inform 6.15 was the last release which supported creating Z-code version
67+
3 (ZIP) games which are suitable to be played on 8-bit micros. This
68+
release specifically supports creating Atari XL/XE disk images.
69+
70+
More resources:
71+
http://www.inform-fiction.org
72+
http://www.ifarchive.org
73+
http://en.wikipedia.org/wiki/Interactive_fiction
74+
.Sh OPTIONS
75+
The following command line arguments are supported:
76+
.Bl -tag -width Fl
77+
.It Fl 5
78+
create Z-code V5 release.
79+
.It Fl r
80+
replay game from a transcript file.
81+
.It Fl w
82+
replay game from a walkthrough file.
83+
.It Fl h
84+
show usage.
85+
.Sh EXAMPLES
86+
.nf
87+
$ inf game.inf
88+
89+
which compiles your source file into a Z-code v3 release. It also
90+
creates Atari XL/XE MD disk image ready to be played.
91+
92+
If you have a transcript file from game, you can use the -r option to
93+
replay it in game.z3
94+
95+
$ inf -r game.scr game.z3
96+
97+
You will receive three files.
98+
game.scr - new transcript file
99+
game.key - walkthrough file
100+
game.qzl - save game from a transcript file
101+
102+
You can also construct a simple walkthrough file and then automatically
103+
replay its sequence of commands in your games.
104+
105+
Example of a game.key
106+
L
107+
N
108+
W
109+
GET LAMP
110+
SCORE
111+
112+
A walkthrough file can be very short, meant just to test some sequence
113+
of commands within your game, or it can be a full solution walkthrough.
114+
115+
$ inf -w game.key game.z3
116+
117+
Once again you will receive three files.
118+
game.scr - new transcript file
119+
game.key - walkthrough file
120+
game.qzl - save game from a walkthrough file
121+
.Sh FILES
122+
.Bl -tag -width ".Pa /usr/local/share"
123+
.It Pa /usr/local/share/inform615
124+
.Sh SEE ALSO
125+
.Xr frotz 6
126+
.Sh AUTHORS
127+
.An Graham Nelson <graham@gnelson.demon.co.uk> -- Inform programming
128+
language and compiler
129+
.An Andy Kosela <akosela@andykosela.com> -- inf tool and packaging
130+
.Sh THANKS TO
131+
Will Crowther and Don Woods for creating the original Adventure, Infocom
132+
for the Z-machine standard and memorable titles like Zork, Graham Nelson
133+
for designing this beautiful engine for creating worlds in text.
134+
135+
rec.arts.int-fiction and rec.games.int-fiction community of IF authors
136+
and enthusiasts.

0 commit comments

Comments
 (0)