The Dink Network

Reply to Re: New Contest: Silent Protagonist

If you don't have an account, just leave the password field blank.
Username:
Password:
Subject:
Antispam: Enter Dink Smallwood's last name (surname) below.
Formatting: :) :( ;( :P ;) :D >( : :s :O evil cat blood
Bold font Italic font hyperlink Code tags
Message:
 
 
October 10th 2014, 11:12 AM
slimeg.gif
metatarasal
Bard He/Him Netherlands
I object 
Storing strings isn't the problem, you can store a couple of characters into one int if you want. For example I could give every characters a number between 1 and 26 and store the word 'Dink' like:
4091411 Where 'D' = 4, 'I' = 9, 'N' = 14 and 'K' = 11
You just take the modulus of 100 every time to get the next characters out. Actually it works even more efficiently if you take the modulus of 26 every time and store the characters in reverse order, but then it's harder to see which word it would be in this particular example. The math is actually pretty straightforward and no problem for the Dink engine. In Dink v1.08 there's even a built-in modulus function I believe. (You could also easily write one yourself though.)

So storing strings isn't the problem and retrieving it is not the problem either. The problem is how to make a single line of text out of it. I could basically take the above example and figure out in which order the characters should be, but it won't really help me anything. Here's a bit of scripting to show what I mean:

if (&var == 1)
say("`%a",&current_sprite);
if (&var == 2)
say("`%b",&current_sprite);
if (&var == 3)
say("`%c",&current_sprite);
if (&var == 4)
say("`%d",&current_sprite);
if (&var == 5)
say("`%e",&current_sprite);
if (&var == 6)
say("`%f",&current_sprite);
if (&var == 7)
say("`%g",&current_sprite);
if (&var == 8)
say("`%h",&current_sprite);
//and so on


You could make 26 of these and loop them to say each character in the word. But what you really want is to get all of the characters in the same sentence. To make a script that includes all 456976 ways you can combine 26 characters in a 4 letter word is plain impossible. That's where the problem is, not with storing or figuring out what is stored, but with actually making it back into a string.