Source code of Theatre available?

Howdy. New user here, I introduced myself just now in the appropriate topic in ‘General…’ forum …
So, my question … I just finished playing Theatre and quite enjoyed it. I aspire to someday complete my own IF game(s), and think it would be QUITE informative to have a look through the source for Theatre … or Anchorhead for that matter, one of the other few games I’ve fully completed. I don’t see the source for either available anywhere. Is that just how it is, or does it exist someplace I have not yet looked?
That is all.
Thanks in advance for any and all responses.

Hi!

I don’t know about Theatre, but the first five rooms of Anchorhead has had their source code published. Given the version of Inform 7 intended to run it (3L95), I’d be surprised if (a) several things in it aren’t easier to do today and (b) if the code can be made to compile as it is.

Either way, it should be an interesting read. I don’t think I’ll take a look myself until I’ve played the game.

The source code for Theatre is at least not linked from the IFDB, so I guess it’s not available. This might be a useful link for you: a list of games with Inform 7 source code.

Hey thanks! quick responses.
I’ll certainly look at the I7 sources provided, and thank you. I’m still coding in I6 tho as I’m grokking the object oriented nature of I6 much better than the rule-based methods of I7. I certainly have other questions about transitioning from I6 to I7, but haven’t had enough experience yet with I7 to know what questions I need to ask.
The biggest one, I guess, so far, is this: I’ve got a little over 1200 lines of I6 code for a game I’ve been working on on and off since 2003 ( I know, LONG time … 1st game, got a bit too ambitious …). Is there an “easy” way to port my I6 code to I7? Or am I pretty much back at square one there … descriptive text and whatnot aside?
Also, I know I7 compiles to I6 code, but seems to delete that file once it compiles the I6 code. Is there a way to save the I6 code so I can look through it?
Thanks again.

Regarding transitioning: I think there’s no way to re-use your I6 code (except of course, as you said, the descriptive text).

If you decide to stay with I6, you might find this list of games with available I6 source code useful.

Regarding the other question:
You can see the I6 output of Inform7 in the “auto.inf” file in the “Build” subdirectory of your “Projectname.inform” directory (leave the IDE running in the background, otherwise it will clean up the files). I’m not an I6 coder, but from what I’ve read on the forum and newsgroup, since the auto-generated output is not intended for human “consumption”, it’s not really structured and written like a human programmer would write it.

You can set your preferences so that the IDE doesn’t clean up the files when you quit it; I think you do it by unchecking “clean build files from projects before closing” on the Advanced tab of the preferences.

Also, if you’re using a Mac, the way you get to the subdirectory is to right-click (or ctrl-click) on the file and choose “Show Package Contents.” (And then go to the “Build” folder, I think? The one I just tried is empty, but that may be because I saved the project without compiling it, and in fact it’s in an uncompilable state.)

Yeah, you can glean some things from it (because a lot of the Inform 7 source is added as comments), but it’s definitely not code that will be particularly useful for you.

But of course there’s nothing wrong with using Inform 6, and StJohn has already posted the appropriate link. If you like the language and have 1200 lines of code in it, I would stick with it at least for this game.

autogenerated code never is particularly ‘human readable’ … but I do find it interesting that all these ‘new features’ of Inform 7 are actually parsed down to Inform 6 before they’re fully compiled into z-code or glulxe … that basically means that all the functionality of I7 actually already exists in I6 … but I’m sure it’s a bitch to code by hand :wink:
I7 makes it easier and perhaps more immediately intuitive. i have yet to work that part out, but I DO see how quick it can be to code up a few rooms and objects real real quick. I also VERY MUCH like the IDE, and the way extensions work. I’ve had problems (lord what problems) incorporating external libraries into my I6 code. Not that I’ve done much I6 coding … clearly … have yet to finish ONE title … I was trying to use a certain NPC library that eventually totally pooched my code for no apparent reason. Worked fine for awhile, but then just suddenly stopped working, froze up any interpreter I tried to use. I’m still rather curious what happened, 'cause using that NPC library was becoming somewhat critical to my game and getting my NPCs to ‘easily’ do what I wanted. As I recall, that’s what ground me to a halt my last go-round with this damned story I’m trying to finish LOLz
Anyhow, I know this isn’t the coding forum, so I should really go there to discuss this stuff. I was just looking for the source of Theatre here. heh.
I’m thinkin I might leave this one set aside for awhile, and try something new and fresh in I7 …

This is in fact true for any Turing-complete programming language. In theory I7 could use BASIC as the intermediary language just as well (although it wouldn’t be very practical or efficient).

The fact that a language is Turing-complete only proves that you can implement any algorithm in it; it doesn’t guarantee any specific I/O capabilities. For instance, no matter how awesome your programming skills, no Inform 7 program will be able to use my GeForce 9600. You could implement every algorithm in OpenGL 3.0 and DirectX 11 in Inform 7, but there is just nothing that the compiler is going to compile into instructions that will be sent to the video card.

So I would say that there is more to functionality than just Turing-completeness. :slight_smile: (Of course, the original statement that all I7 functionality exists in I6 because I7-code gets compiled to I6-code is very true.)

Of course, but that doesn’t have much relevance in this particular issue because I6/7 doesn’t have any special I/O capabilities either: the only additional capability required here is that the language must be able to create and write to files.

I agree. But you explicitly generalised to all Turing-complete languages. :slight_smile: