Search found 3462 matches

by BasicCoder2
Jul 09, 2020 15:34
Forum: Game Dev
Topic: making a text adventure game
Replies: 6
Views: 211

Re: making a text adventure game

Sounds like a clear case for inheritance. Yes something like that. But I am getting ahead of myself here. I just see it as a mental challenge to think about how it might be done. In the meantime I am thinking about how to code a simple text based game using FreeBasic and writing experimental code l...
by BasicCoder2
Jul 09, 2020 0:35
Forum: Game Dev
Topic: making a text adventure game
Replies: 6
Views: 211

Re: making a text adventure game

@grindstone Thank you for the suggestions and accompanying code examples. I had thought about what you have suggested. We have the real world as an extended data base. Indeed our internal data base is derived from that real world. The presence of a troll, apple or treasure can be "seen" wh...
by BasicCoder2
Jul 08, 2020 22:47
Forum: General
Topic: ReDim inside TYPEs
Replies: 4
Views: 168

Re: ReDim inside TYPEs

@Xusinboy Bekchanov Thank you. An actual example of the solution helps. @fxm Thank you. I did look for example code with the FBIDE help. I probably read that line of text without really realising that was the solution. Here is the working code for anyone that might be interested: screenres 900,500,3...
by BasicCoder2
Jul 08, 2020 11:45
Forum: General
Topic: ReDim inside TYPEs
Replies: 4
Views: 168

ReDim inside TYPEs

Is it possible to re dimension an array within a type? I want to add new connections between locations. error 3: Expected End-of-Line, found '.' in 'ReDim Preserve locs(fromLoc).connection(UBound(locs(fromLoc).connection) + 1) screenres 900,500,32 color rgb(0,0,0),rgb(255,255,255):cls Type LOCATION ...
by BasicCoder2
Jul 08, 2020 11:42
Forum: Game Dev
Topic: making a text adventure game
Replies: 6
Views: 211

Re: making a text adventure game

@grindstone,

Thanks for the suggestions. I had also forgotten how to use redim which I had intended to use as well so your example came in handy.
by BasicCoder2
Jul 07, 2020 6:44
Forum: Game Dev
Topic: making a text adventure game
Replies: 6
Views: 211

making a text adventure game

Last weekend I spent some time on the internet looking for tutorials on the how to write a text based adventure game. There was a QBASIC example but I find the old gosub, goto code unreadable requiring hours to decipher. These days when I search for any coding examples they all seem to be written in...
by BasicCoder2
Jun 30, 2020 17:06
Forum: General
Topic: Embedding a Spreadsheet
Replies: 34
Views: 1092

Re: Embedding a Spreadsheet

I have never used spreadsheets, I don't know how functions are represented in them. sorry. How I would imagine it is as a 2d array of values. It can assume a cell contains an expression and the value in that cell will be the result of the evaluation of that expression. A simple expression might be ...
by BasicCoder2
Jun 28, 2020 1:45
Forum: Projects
Topic: Old school text adventure as a way of re-learning coding
Replies: 32
Views: 1093

Re: Old school text adventure as a way of re-learning coding

@olympic sleeper: do you plan to have conversations? Graphic adventure games usually have other characters to fight, to buy things from and have simple conversations. A character might provide information to the player or be a source of some item the player might need. It seems to me the difference...
by BasicCoder2
Jun 27, 2020 19:23
Forum: Projects
Topic: Old school text adventure as a way of re-learning coding
Replies: 32
Views: 1093

Re: Old school text adventure as a way of re-learning coding

‘say hello to shopkeeper and then buy a shirt from them' This doesn't make sense, them is for plural, shopkeeper is only one. So how would you write it when the gender of the shopkeeper is unknown? "Singular they is the use in English of the pronoun they or its inflected or derivative forms, t...
by BasicCoder2
Jun 27, 2020 13:36
Forum: Projects
Topic: Old school text adventure as a way of re-learning coding
Replies: 32
Views: 1093

Re: Old school text adventure as a way of re-learning coding

However, the OP stated he wanted something like Zork, which was notorious for being able to parse virtually any input. Sure I understood that. So the first thing I did was search the internet for an explanation or at least a description of how Zork parses a sentence. One such page seemed to indicat...
by BasicCoder2
Jun 27, 2020 1:39
Forum: Projects
Topic: Old school text adventure as a way of re-learning coding
Replies: 32
Views: 1093

Re: Old school text adventure as a way of re-learning coding

I assume a user will soon learn what kinds of sentences the game can handle and the game can always request the sentence be repeated another way or in a simpler form or even as a series of sentences. Just as we adjust our sentences according to the age of the listener so to we can adjust our sentenc...
by BasicCoder2
Jun 26, 2020 23:21
Forum: Projects
Topic: Old school text adventure as a way of re-learning coding
Replies: 32
Views: 1093

Re: Old school text adventure as a way of re-learning coding

Perhaps break the sentence into parts, " get the red shirt", " get the blue shirt", " put them on the shelf" So you have two get commands and "them" can become a label for all the things that the agent has in the have list? Thus "get the red shirt" b...
by BasicCoder2
Jun 21, 2020 21:11
Forum: Beginners
Topic: Any suggestions on the best way to set up a linked list?
Replies: 24
Views: 809

Re: Any suggestions on the best way to set up a linked list?

Hi basiccoder2. You have done a lot of this kind of stuff, an agent and an environment. But the specific question was for any suggestions on the best way to set up a linked list and others can demonstrate that better than I can although often with fairly unreadable code to someone like me. My impre...
by BasicCoder2
Jun 20, 2020 22:38
Forum: Beginners
Topic: Any suggestions on the best way to set up a linked list?
Replies: 24
Views: 809

Re: Any suggestions on the best way to set up a linked list?

After trying to figure out what you are trying to do it seems to me you need a simple example which can be extended without adding complexity. You also seem to be concentrating on the coding part (pointers, linked lists and so on..) when I would suggest you need a higher level description of what yo...
by BasicCoder2
Jun 19, 2020 21:03
Forum: Beginners
Topic: Any suggestions on the best way to set up a linked list?
Replies: 24
Views: 809

Re: Any suggestions on the best way to set up a linked list?

You seemed to have concluded a linked list is the solution to how to represent this "world"? To me you seem to be describing a tree structure. The trunk is "everything" and branch nodes are things that contain things or spatial relationships. It reminds me of semantic networks an...

Go to advanced search