ProductPromotion
Logo

Kotlin

made by https://0x3d.site

GitHub - ast-hugger/AdventKT: A Kotlin-based DSL for text adventures, with a partial replica of the classic Colossal Cave as an example.
A Kotlin-based DSL for text adventures, with a partial replica of the classic Colossal Cave as an example. - ast-hugger/AdventKT
Visit Site

GitHub - ast-hugger/AdventKT: A Kotlin-based DSL for text adventures, with a partial replica of the classic Colossal Cave as an example.

GitHub - ast-hugger/AdventKT: A Kotlin-based DSL for text adventures, with a partial replica of the classic Colossal Cave as an example.

AdventKT

A Kotlin-based DSL for text adventures, with a partial replica of the classic Colossal Cave as an example.

Background

My main goal was playing with Kotlin to get a feel for what it was like. A text adventure model and DSL were a fun little exercise to do, as well as replicating some of the classic locations, items, and events. However, the game was more of a use case and a test case than a goal in itself. This said, it turned out to be a fairly complete mini-adventure with its own goal and plot.

Locations and item descriptions are generally true to the original, as published by Eric Raymond (see a link below). Some interactions are changed or augmented to try out various engine features, and to keep the world cohesive without replicating it all.

Building and running

Run gradle jar in the project directory to build a jar under build/libs/AdventKT.jar.

Alternatively, open the project directory in IntelliJ (it is a project) and build the AdventKT:jar artifact. This produces out/artifacts/AdventKT_jar/AdventKT.jar.

Run the jar using the advent shell script in the project directory. It runs the jar from the location where the IDE builds it. If using Gradle, edit the path in the script accordingly.

Study pointers for the curious

The game is defined entirely in the ColossalCave class. (Spoiler alert). The class is Kotlin code, but shaped into a DSL. The definition is extensively commented to explain the use of DSL constructs. It's accompanied by global action definitions in ColossalCaveActions.kt

The implementation revolves around four core classes under framework: World, Room, Item, and Action. The DSL expressions in cave.ColossalCave ultimately create a particular structure of those classes and their subclasses.

The world definition DSL as seen in the ColossalCave class is defined by a set of methods in World and Room, and to a lesser degree, the Item class.

Contact

My email is <first name> dot <last name> at gmail dot com.

Links of interest

Open Adventure, the original Colossal Cave version 2.5

Photos of the real world cave

More Resources
to explore the angular.

mail [email protected] to add your project or resources here 🔥.

Related Articles
to learn about angular.

FAQ's
to learn more about Angular JS.

mail [email protected] to add more queries here 🔍.

More Sites
to check out once you're finished browsing here.

0x3d
https://www.0x3d.site/
0x3d is designed for aggregating information.
NodeJS
https://nodejs.0x3d.site/
NodeJS Online Directory
Cross Platform
https://cross-platform.0x3d.site/
Cross Platform Online Directory
Open Source
https://open-source.0x3d.site/
Open Source Online Directory
Analytics
https://analytics.0x3d.site/
Analytics Online Directory
JavaScript
https://javascript.0x3d.site/
JavaScript Online Directory
GoLang
https://golang.0x3d.site/
GoLang Online Directory
Python
https://python.0x3d.site/
Python Online Directory
Swift
https://swift.0x3d.site/
Swift Online Directory
Rust
https://rust.0x3d.site/
Rust Online Directory
Scala
https://scala.0x3d.site/
Scala Online Directory
Ruby
https://ruby.0x3d.site/
Ruby Online Directory
Clojure
https://clojure.0x3d.site/
Clojure Online Directory
Elixir
https://elixir.0x3d.site/
Elixir Online Directory
Elm
https://elm.0x3d.site/
Elm Online Directory
Lua
https://lua.0x3d.site/
Lua Online Directory
C Programming
https://c-programming.0x3d.site/
C Programming Online Directory
C++ Programming
https://cpp-programming.0x3d.site/
C++ Programming Online Directory
R Programming
https://r-programming.0x3d.site/
R Programming Online Directory
Perl
https://perl.0x3d.site/
Perl Online Directory
Java
https://java.0x3d.site/
Java Online Directory
Kotlin
https://kotlin.0x3d.site/
Kotlin Online Directory
PHP
https://php.0x3d.site/
PHP Online Directory
React JS
https://react.0x3d.site/
React JS Online Directory
Angular
https://angular.0x3d.site/
Angular JS Online Directory