TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

How to program a text adventure in C (2016)

177 pointsby phodoabout 5 years ago

8 comments

bserfatyabout 5 years ago
I suggest to look into <a href="https:&#x2F;&#x2F;ifcomp.org&#x2F;" rel="nofollow">https:&#x2F;&#x2F;ifcomp.org&#x2F;</a> - the annual interactive fiction competition is running for 25 years now and there are some great games and resources over there.
评论 #22654479 未加载
franzeabout 5 years ago
Ask HN: what&#x27;s a good JS (browser focused) text adventure engine? I see me making a text adventure (adding one mini chapter) each day as a good lockdown project.<p>Note: I might call it &quot;Everything is better in quarantine.&quot; The goal would be to (not) go mad.
评论 #22653958 未加载
评论 #22656214 未加载
评论 #22654476 未加载
评论 #22654105 未加载
评论 #22654635 未加载
评论 #22657072 未加载
japanoiseabout 5 years ago
I like this, very creative!<p>The code generation looks interesting. I&#x27;ll have to take another look later; can it not be done with the preprocessor?
hendrikhalkowabout 5 years ago
Awesome work. Thanks. Looking forward to see more of those vintage games again :)
hereisdxabout 5 years ago
Wow! This tutorial was very fun to follow.
disqardabout 5 years ago
Thank you for writing this up!
gustavorgabout 5 years ago
This programmer, Mr. Ruud Helderman, is like Cool McCool, &quot;Danger is my business!&quot;. For example, the parser, function matchParam:<p><pre><code> OBJECT *obj; par-&gt;tag = src; par-&gt;distance = *src == &#x27;\0&#x27; ? distNoObjectSpecified : distUnknownObject; forEachObject(obj) ... </code></pre> The initialization of the obj variable received an obliviate spell.<p>Also function parseAndExecute (). The way he deal with invalid input is, epic:<p><pre><code> static const COMMAND commands[] = { {executeQuit , &quot;quit&quot;}, {executeLookAround, &quot;look&quot;}, ... } for (cmd = commands; !matchCommand(input, cmd-&gt;pattern); cmd++); return (*cmd-&gt;function)();</code></pre>
评论 #22654432 未加载
评论 #22656222 未加载
评论 #22655384 未加载
评论 #22656665 未加载
anthkabout 5 years ago
It&#x27;s ok, but inform 6 is better for this.
评论 #22656149 未加载
评论 #22657209 未加载