TinTin++ Mud Client The TinTin++ message board

 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
TinTin++ Mud Client

TinTin++ 1.99.7 (beta)

 
Post new topic   This topic is locked: you cannot edit posts or make replies.    The TinTin++ message board Forum Index -> Announcements
View previous topic :: View next topic  
Author Message
Scandum
Site Admin


Joined: 03 Dec 2004
Posts: 3770

PostPosted: Wed Jul 08, 2009 10:59 pm    Post subject: TinTin++ 1.99.7 (beta) Reply with quote

In this beta I've changed the code to use sorted arrays instead of linked lists. The main advantage of this is that variables and functions can be looked up very quickly using a binary search.

The next thing I'm planning to do is to add support for nested associative arrays.

http://tintin.sourceforge.net/download/tintin-beta.tar.gz

Changes:

Code:

llist.c        Switched from linked lists to sorted arrays.

cursor.c       Replaced #cursor echo with 'echo on' and 'echo off'

cursor.c       Modifying the input buffer while tabbing will reset the
               tab finder.                                           


Feel free to give it a whirl and report any bugs. I'm also curious if there's a noticeable difference in performance.
Back to top
View user's profile Send private message Send e-mail
reality3k



Joined: 11 Feb 2009
Posts: 48

PostPosted: Thu Jul 09, 2009 9:37 am    Post subject: Reply with quote

The priority checking for an action seems messed up.

Code:

#action {test me} {#show caught 2} {10}
#OK. {test me} NOW TRIGGERS {#show caught 2} @ {10}.
#action {test} {#show caught 1}
#OK. {test} NOW TRIGGERS {#show caught 1} @ {5}.
#showme test me
caught 2
test me


It -seems- like it always does the first one unless the priority is set identical. This behavior is different than 1.99.6.
Back to top
View user's profile Send private message
Scandum
Site Admin


Joined: 03 Dec 2004
Posts: 3770

PostPosted: Thu Jul 09, 2009 4:14 pm    Post subject: Reply with quote

It was comparing strings rather than integers. Should be fixed in the newly uploaded beta, and thanks for testing!

The new beta allows the following:

#var bla[4] 6
#var bli[$bla[4]] hello
#showme $bli[6]

Not the most useful thing. More to follow.
Back to top
View user's profile Send private message Send e-mail
Scandum
Site Admin


Joined: 03 Dec 2004
Posts: 3770

PostPosted: Sun Jul 12, 2009 1:33 am    Post subject: Reply with quote

I uploaded a new beta which supports nested variables.

Changes:

1. ${+1} now references the first variable, ${+2} the second, etc. ${-1} can be used to reference the last variable. This is mainly useful for nested variables.

2. Uninitialized nested variables now return 0. This change has backward compatibility issues.

3. Added nested variables with behavior similar to associative arrays. For example: #var $bla[this][that] 1

4. Accessing a variable that contains a nesting will print all indices for that variable. #showme $bla[this] would print: {that}{1}

5. Added basic support for nested variables to the #list command.

6. $var[1] $var[2] support for #list variables no longer works.

Example:
Code:

#var bla[bli] 1
#var bla[blo] 1
#var bla[blu] 1
#showme $bla
#showme $bla[bli]
#showme $bla[-1]
#var bli[bla][blo] 2
#showme $bli[bla][blo]
#showme $bli[1][1]


Last edited by Scandum on Sun Aug 02, 2009 2:10 pm; edited 1 time in total
Back to top
View user's profile Send private message Send e-mail
Scandum
Site Admin


Joined: 03 Dec 2004
Posts: 3770

PostPosted: Sun Jul 12, 2009 11:58 pm    Post subject: Reply with quote

Code:

data.c         Sorting numeric variables as integers instead of as strings.

text.c         Fixed crash bug in word wrap code.

net.c          Fixed double action triggering on prompts in split mode.
Back to top
View user's profile Send private message Send e-mail
Scandum
Site Admin


Joined: 03 Dec 2004
Posts: 3770

PostPosted: Mon Jul 13, 2009 10:38 am    Post subject: Reply with quote

Code:

math.c         Fixed crash bug with #math.

list.c         Added list srt and ins support for nested list variables.
Back to top
View user's profile Send private message Send e-mail
Scandum
Site Admin


Joined: 03 Dec 2004
Posts: 3770

PostPosted: Tue Jul 14, 2009 11:26 pm    Post subject: Reply with quote

I added #switch, #case, and #default which work more or less the same as the C equivalent.

Example:

Code:

#switch {1d4}
{
    #case 1 #showme 1;
    #case 2 #showme 2;
    #default #showme default
}
Back to top
View user's profile Send private message Send e-mail
Scandum
Site Admin


Joined: 03 Dec 2004
Posts: 3770

PostPosted: Thu Jul 16, 2009 12:02 am    Post subject: Reply with quote

Added MAP EXIT ROOM event.

Accessing a nested variables by their index now requires using a + before the index number.

So $bla[+1] would print the first nested variable inside $bla, and $bla[1] would print the variable named 1 inside $bla.

Also fixed a sorting issue.
Back to top
View user's profile Send private message Send e-mail
Scandum
Site Admin


Joined: 03 Dec 2004
Posts: 3770

PostPosted: Thu Jul 16, 2009 1:07 pm    Post subject: Reply with quote

Fixed a bug with #write not saving aliases and actions.

Added the #while command to the script tokenizer and added #break and #continue to work with it. They work pretty much the same way as in C. Keep in mind that using #break is currently not required when using #switch, this because each #case automatically acts like it has a #break included.

Keep in mind that #break and #continue won't work with #loop or #forall, they will in the future though.

Fixed a bug with #read.
Back to top
View user's profile Send private message Send e-mail
Scandum
Site Admin


Joined: 03 Dec 2004
Posts: 3770

PostPosted: Fri Jul 17, 2009 10:11 am    Post subject: Reply with quote

Added #loop to the script tokenizer. Due to the peculiar way tintin worked in the past I had to change its behavior however. The new syntax is:

#loop {<min>} {<max>} {<var>} {commands}

For example:
Code:

#loop 0 4 cnt1
{
    #loop 5 9 cnt2
    {
        #showme The count is $cnt1 and $cnt2
    }
}


Last edited by Scandum on Fri Jul 24, 2009 7:35 pm; edited 1 time in total
Back to top
View user's profile Send private message Send e-mail
Scandum
Site Admin


Joined: 03 Dec 2004
Posts: 3770

PostPosted: Fri Jul 17, 2009 11:18 pm    Post subject: Reply with quote

Added #else and #elseif statements to the script tokenizer.

Example:

Code:

#debug alias on
#alias {blu}
{
        #loop {1 cnt 4}
        {
                #if {1 == $cnt}
                {             
                        #nop 1
                };           
                #elseif {2 == $cnt}
                {                 
                        #nop 2
                };           
                #elseif {3 == $cnt}
                {                 
                        #nop 3
                };           
                #else
                {   
                        #nop 4
                }             
        }       
}


Old school else and elseif still work, but this looks nicer.
Back to top
View user's profile Send private message Send e-mail
Scandum
Site Admin


Joined: 03 Dec 2004
Posts: 3770

PostPosted: Sat Jul 18, 2009 11:32 pm    Post subject: Reply with quote

Using &<variable name> will report the variable's index number.

For example:
Code:

#var bla[w] 1;
#var bla[x] 3;
#var bla[y] 5;
#showme Test &bla[v] &bla[w] &bla[x] &bla[y] &bla[z]

Will print:

Test 0 1 2 3 0


It's now possible to directly assign nested variables:

#var bla {{w}{1}{x}{3}{y}{5}}

Notice variables are assigned as pairs of braces. To see the full nesting you'd use: #showme $bla which would print {{w}{1}{x}{3}{y}{5}}. To only see the first level of nesting you'd use: #showme $bla[] which would print {w}{x}{y}


Also added support for calcalutions within braces:
Code:

#var bla {{w}{1}{x}{3}{y}{5}}
#showme Test $bla[+1] $bla[+1+1]

Will print: Test 1 3

Notice that $bla[1] would return 0 because there is no nested variable with the name 1.
Back to top
View user's profile Send private message Send e-mail
Scandum
Site Admin


Joined: 03 Dec 2004
Posts: 3770

PostPosted: Sun Jul 19, 2009 11:25 pm    Post subject: Reply with quote

#read and #write now work properly with nested variables.

Updated #list to work with the latest nesting code. Still have to remove old #list support.

#kill now takes an optional second argument, for example: #kill alias bla* which is the same as #unalias bla*
Back to top
View user's profile Send private message Send e-mail
Scandum
Site Admin


Joined: 03 Dec 2004
Posts: 3770

PostPosted: Mon Jul 20, 2009 12:19 pm    Post subject: Reply with quote

No longer stripping spaces in verbatim mode.

Fixed up #list support to work fully (and only) with nested variables.

Old #list code may work, though parsing lists is more involved now.

Example:

Code:

#list test ins -1 a
#list test ins -1 b
#list test ins -1 c

#forall {$test[]}
{
    #showme $test[&0]
}

#nop or alternatively:

#loop {1} {&test[]} {cnt}
{
    #showme $test[$cnt]
}

#nop or alternatively:

#foreach {$test[]} {temp}
{
    #showme $test[$temp]
}


Last edited by Scandum on Sun Aug 02, 2009 2:16 pm; edited 2 times in total
Back to top
View user's profile Send private message Send e-mail
Scandum
Site Admin


Joined: 03 Dec 2004
Posts: 3770

PostPosted: Fri Jul 24, 2009 7:34 pm    Post subject: Reply with quote

1) For now I've settled on changing the #loop syntax to:
Code:

#loop {min} {max} {variable} {commands}


This seems to be most in line with generic tintin syntax, for example:
Code:

#loop 1 10 cnt #showme $cnt


2) The argument list of #format and #echo are no longer nested, this probably requires many scripts to be updated, but like with loop this is more in line with the generic tintin syntax.

Old syntax:

Code:
#format temp {%+20s %+20s} {{hello} {world}}


New syntax:

Code:
#format temp {%+20s %+20s} {hello} {world}


3) Now only showing nested variables that do not exist as 0 so tintin doesn't behave oddly when editing mobprogs. For example:
Code:

#showme $bla[1]
$bla[1]
#var bla {}
#showme $bla[1]
0
Back to top
View user's profile Send private message Send e-mail
Scandum
Site Admin


Joined: 03 Dec 2004
Posts: 3770

PostPosted: Sun Jul 26, 2009 12:09 pm    Post subject: Reply with quote

1) Added #write support for #loop and #foreach.

2) Added #foreach {list} {variable} {commands}

This is the replacement for #forall and you can use #break and #continue within it.
Back to top
View user's profile Send private message Send e-mail
Scandum
Site Admin


Joined: 03 Dec 2004
Posts: 3770

PostPosted: Mon Jul 27, 2009 8:54 am    Post subject: Reply with quote

1) Renamed #replacestring to #replace

2) All commands now use tintin regular expressions. Instead of * and ? use %* and %? - for perfect matches uses ^string$.

This change also affects the #regexp and #if commands.

3) #parse syntax is now: #parse {string} {variable} {commands} and can be interupted by the #break #continue and #return command.

These changes should be the last major ones for this beta.
Back to top
View user's profile Send private message Send e-mail
Scandum
Site Admin


Joined: 03 Dec 2004
Posts: 3770

PostPosted: Sat Aug 01, 2009 10:49 pm    Post subject: Reply with quote

Improved verbatim behavior.
Back to top
View user's profile Send private message Send e-mail
Scandum
Site Admin


Joined: 03 Dec 2004
Posts: 3770

PostPosted: Sun Aug 02, 2009 11:45 pm    Post subject: Reply with quote

Updated help files and fixed a bug with #elseif parsing and session switching.

Things seem to be fairly stable at the moment.
Back to top
View user's profile Send private message Send e-mail
titeuf



Joined: 29 Jul 2006
Posts: 84

PostPosted: Tue Aug 04, 2009 11:45 am    Post subject: Reply with quote

This is just a small thing, but list fnd doesn't work with empty lists:
Code:

#list afflictions clr
#list afflictions fnd test test
#LIST FND: {afflictions} is not a list.

Shouldn't it just return 0 then instead?
Back to top
View user's profile Send private message
Scandum
Site Admin


Joined: 03 Dec 2004
Posts: 3770

PostPosted: Tue Aug 04, 2009 12:27 pm    Post subject: Reply with quote

Yeah, definitely needs to return 0. Fixed this for both the fnd and get option. Also fixed nested #break handling and an issue with variable handling for #loop #foreach and #parse.

I've updated the beta file, as I try to do with each update post in this topic.

To check if a variable exists use:

#if {&{variable}} {#showme exists}

This will work for both nested and unnested variables. To check if an unnested variable exists you can use: #if {"$variable" == "%.variable"} since "?variable" is no longer valid.
Back to top
View user's profile Send private message Send e-mail
Scandum
Site Admin


Joined: 03 Dec 2004
Posts: 3770

PostPosted: Tue Aug 04, 2009 5:23 pm    Post subject: Reply with quote

Nested variables defined in the startup session are now inherited by new sessions.
Back to top
View user's profile Send private message Send e-mail
Scandum
Site Admin


Joined: 03 Dec 2004
Posts: 3770

PostPosted: Wed Aug 05, 2009 10:57 am    Post subject: Reply with quote

Lists in #map get exits {variable}, #script {var} {shell command}, and #format {variable} {%w} {string}, now create proper nested lists.

Triggers that don't contain a %0-%99 argument properly handle paranthesis () within braces(). As in: #act {Bubba {(stands|sits) (on a chair)} here} will assign %3 to 'on a chair'.
Back to top
View user's profile Send private message Send e-mail
titeuf



Joined: 29 Jul 2006
Posts: 84

PostPosted: Wed Aug 05, 2009 12:30 pm    Post subject: Reply with quote

Code:
$wget "http://tintin.sourceforge.net/download/tintin-beta.tar.gz"
--2009-08-05 19:29:00--  http://tintin.sourceforge.net/download/tintin-beta.tar.gz
Resolving tintin.sourceforge.net... 216.34.181.96
Connecting to tintin.sourceforge.net|216.34.181.96|:80... connected.
HTTP request sent, awaiting response... 403 Forbidden
2009-08-05 19:29:01 ERROR 403: Forbidden.


Latest upload messed it up? Or just a temporary sourceforge problem?
Back to top
View user's profile Send private message
Scandum
Site Admin


Joined: 03 Dec 2004
Posts: 3770

PostPosted: Wed Aug 05, 2009 12:51 pm    Post subject: Reply with quote

My mistake, should be downloadable now.
Back to top
View user's profile Send private message Send e-mail
Shaiith



Joined: 11 Jul 2009
Posts: 64

PostPosted: Thu Aug 13, 2009 7:48 pm    Post subject: Reply with quote

Quick question, is 1.99.7 beta more advanced than 1.99.6b2 ? I'm assuming the latter is a stepping stone to this codebase.
Back to top
View user's profile Send private message
Scandum
Site Admin


Joined: 03 Dec 2004
Posts: 3770

PostPosted: Thu Aug 13, 2009 8:11 pm    Post subject: Reply with quote

The file at http://tintin.sourceforge.net/download/tintin-beta.tar.gz is generally the most advanced version when there's active beta testing, and it's what I typically refer to as the 1.99.7 beta.

1.99.6b2 is an official beta release of the 1.99.7 beta.
Back to top
View user's profile Send private message Send e-mail
Display posts from previous:   
Post new topic   This topic is locked: you cannot edit posts or make replies.    The TinTin++ message board Forum Index -> Announcements All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
Get TinTin++ Mud Client at SourceForge.net. Fast, secure and Free Open Source software downloads Get TinTin++ Mud Client at SourceForge.net. Fast, secure and Free Open Source software downloads
TinTin++ Homepage

Powered by phpBB © 2001, 2002 phpBB Group