Login
Back to forumReply to this topicGo to last reply

Posted By

Harry Potter
on 2022-07-02
18:30:22
 Addition to CBMSimpleIO: printtok()

Hi! I asked for help with shortening the size of a text adventure on the Lemon64 forum and was told I can tokenize strings. printtok() is a function that prints a string but substitutes tokens within a string with the indicated string. It is available at https://sourceforge.net/projects/cc65extra/files/ui/ but is currently separate from the CBMSimpleIO package. I also want, at commodorejohn's suggestion, to make a function to decompress a string from 7 bits per character to 8. Does anybody here have any other ideas to optimize a text adventure?

Posted By

SVS
on 2022-07-03
06:39:35
 Re: Addition to CBMSimpleIO: printtok()

You can create a dictionary with all the allowed words (commands) translated as tokens. In this way you can reduce the length of the strings.
Another idea: you can use the teletype system. It had 5 bits for each character (32 single characters). One of them is an escape function to switch onto a second table. Tell me if you need more info.

Posted By

Harry Potter
on 2022-07-03
06:54:22
 Re: Addition to CBMSimpleIO: printtok()

Do you mean refer to the verbs and nouns as a #? If so, I am already doing that. If not, I don't understand. sad

Posted By

Chronos
on 2022-07-03
06:58:03
 Re: Addition to CBMSimpleIO: printtok()

Dear Harry Potter! Just a friendly advice: can you open only one topic for your requests? you're ruining the whole forum on p4w... thanks! (You can name it as "Harry Potter's Programming Corner" or "Harry, where's my car?" or something like this).

Posted By

SVS
on 2022-07-03
12:31:06
 Re: Addition to CBMSimpleIO: printtok()

>>Do you mean refer to the verbs and nouns as a #? If so, I am already doing that. If not, I don't understand.

Yes indeed, you can "pack" each legal word as a number that is the index of the decoding table. One special value (for example: 0) can be used to set an alternate table. If the tables contains less than 32 values, you can use just 5 bits for each token.

Posted By

Harry Potter
on 2022-07-03
12:36:26
 Re: Addition to CBMSimpleIO: printtok()

I have a more complicated structure: 255 verbs, 128 nouns, 255 aliases, each of which translates to a noun, 32 categories, each of which can stand for one of two or more nouns, 4 directions, upgradable to 15 and 32 characters.

Posted By

JamesC
on 2022-07-03
18:41:34
 Re: Addition to CBMSimpleIO: printtok()

Dear Harry Potter! Just a friendly advice: can you open only one topic for your requests?

I second Chronos' request.

Just a quick look at the most recent threads: 9 out of 24 were started by you within the last 14 days (give or take) = 37.5%. This seems a bit much, especially when two threads have no response at all and several other threads only have one other participant.

And since you don't seem to have a forum ID number, other forum members cannot block your threads so we do not see them.

And one of the forum moderators condensed your threads a few weeks ago, politely advising you to update existing threads rather than starting new ones.

Please, either stay to one thread, or start your own forum so that you can post as freely as you like.

Posted By

Csabo
on 2022-07-03
19:20:20
 Re: Addition to CBMSimpleIO: printtok()

"And since you don't seem to have a forum ID number, other forum members cannot block your threads so we do not see them." -> You can actually, just enter the name you wish to block. It doesn't have to be a number. You can mix and numerical match member ids and regular usernames.

Posted By

JamesC
on 2022-07-03
21:22:31
 Re: Addition to CBMSimpleIO: printtok()

@Csabo: entering "Harry Potter" without a comma after = no effect, because he posts as a guest.

Blocking user number 0 = blocks all guest posts, not just his.
Blocking "Harry Potter," (with a comma after) = a forum listing of only his threads. surprised

Posted By

gerliczer
on 2022-07-04
00:13:05
 Re: Addition to CBMSimpleIO: printtok()

I agree with Chronos and JamesC.

@Harry Potter: Sir, please do not use this forum as a blog.

Posted By

siz
on 2022-07-04
08:33:18
 Re: Addition to CBMSimpleIO: printtok()

@JamesC
Blocking "Harry Potter," (with a comma after) = a forum listing of only his threads.

My blocking settings: "Harry Potter" without the comma. Works perfectly. wink Unfortunately You have to do this on every browser You use so sometimes I run into his posts anyway.



Back to topReply to this topic


Copyright © Plus/4 World Team, 2001-2024. Support Plus/4 World on Patreon