Testo Lingua avventurosa

4

Stavo pensando di creare un gioco di avventura testuale e, dopo una piccola ricerca su google, ho scoperto che in Prolog sono stati creati alcuni giochi di avventura (semplici) di testo.

Perché?

    
posta Shevliaskovic 16.11.2013 - 17:48
fonte

1 risposta

8

Da Esplorazione del Prolog :

As I was writing the utility functions for my game, I happened to go to a Boston Computer Society meeting where the speaker was discussing Prolog. I learned that all of the tools I was building were already integral components of the Prolog language.

Prolog has built-in dynamic memory allocation for storing the state of the game that was better than mine because it had an extremely flexible way of representing the data. It has a built-in pattern-matching capability (unification) that was more general and flexible than the pattern-matcher I was implementing, and it had a built-in search mechanism (backtracking). Further, the dynamic memory allocation didn't just store facts, but stored rules as well, so the "data" could embody its own intelligence.

Because of all of this procedural power built into the language, the code the programmer writes looks much more declarative. An application, such as my adventure game, winds up being reduced to an elegant set of logical declarations describing what the program does. (Developers often claim up to a 10-fold reduction in code size going to Prolog. See for example the PCAI article on KnowledgeWare's use of Prolog in the May/June 1993 issue.) For me, this was truly a fun way to program, capturing the essence of the joy of programming-building logical structures that perform interesting tasks.

    
risposta data 16.11.2013 - 19:37
fonte

Leggi altre domande sui tag