Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.javascript > #33936 > unrolled thread
| Started by | jonas.thornvall@gmail.com |
|---|---|
| First post | 2017-09-01 21:57 -0700 |
| Last post | 2017-09-21 05:32 -0700 |
| Articles | 20 on this page of 22 — 2 participants |
Back to article view | Back to comp.lang.javascript
Counter or Index? jonas.thornvall@gmail.com - 2017-09-01 21:57 -0700
Re: Counter or Index? jonas.thornvall@gmail.com - 2017-09-02 00:05 -0700
Re: Counter or Index? jonas.thornvall@gmail.com - 2017-09-02 00:34 -0700
Re: Counter or Index? jonas.thornvall@gmail.com - 2017-09-02 07:10 -0700
Re: Counter or Index? Ben Bacarisse <ben.usenet@bsb.me.uk> - 2017-09-02 15:32 +0100
Re: Counter or Index? jonas.thornvall@gmail.com - 2017-09-02 07:48 -0700
Re: Counter or Index? jonas.thornvall@gmail.com - 2017-09-02 08:13 -0700
Re: Counter or Index? jonas.thornvall@gmail.com - 2017-09-02 08:18 -0700
Re: Counter or Index? jonas.thornvall@gmail.com - 2017-09-02 08:52 -0700
Re: Counter or Index? jonas.thornvall@gmail.com - 2017-09-02 09:42 -0700
Re: Counter or Index? jonas.thornvall@gmail.com - 2017-09-02 09:54 -0700
Re: Counter or Index? jonas.thornvall@gmail.com - 2017-09-02 10:17 -0700
Re: Counter or Index? jonas.thornvall@gmail.com - 2017-09-03 13:41 -0700
Re: Counter or Index? jonas.thornvall@gmail.com - 2017-09-03 13:58 -0700
Re: Counter or Index? jonas.thornvall@gmail.com - 2017-09-03 14:09 -0700
Re: Counter or Index? jonas.thornvall@gmail.com - 2017-09-03 14:17 -0700
Re: Counter or Index? jonas.thornvall@gmail.com - 2017-09-03 14:33 -0700
Re: Counter or Index? jonas.thornvall@gmail.com - 2017-09-05 01:33 -0700
Re: Counter or Index? jonas.thornvall@gmail.com - 2017-09-15 18:05 -0700
Re: Counter or Index? jonas.thornvall@gmail.com - 2017-09-15 18:06 -0700
Re: Counter or Index? jonas.thornvall@gmail.com - 2017-09-15 18:12 -0700
Re: Counter or Index? jonas.thornvall@gmail.com - 2017-09-21 05:32 -0700
Page 1 of 2 [1] 2 Next page →
| From | jonas.thornvall@gmail.com |
|---|---|
| Date | 2017-09-01 21:57 -0700 |
| Subject | Counter or Index? |
| Message-ID | <2274405e-c00f-4c91-9b6b-0c4ab7577be8@googlegroups.com> |
I am writing some string manipulation algorithms that have are heavily branched to hold like say a chessrecords or other similar structured datasets of information. Should one index the deep of branch or let the algorithm keep track of the depth using delimiters? It seem that index will take extra space, but searching the information will be alot faster because the algorithm do not need the to keep track of search depth? I do realise that this problem probably implemented in pointer structures and maybe in javascript using arrays with subelements/arrays. But i remember doing this type of thing in Basic decades ago, and would check if my brain still up to the task doing it using just string handling. Use dataIndex or algorithm counter to keep track of the depth of data in the set?
[toc] | [next] | [standalone]
| From | jonas.thornvall@gmail.com |
|---|---|
| Date | 2017-09-02 00:05 -0700 |
| Message-ID | <553d4a12-4ab8-44c3-8d16-9a29b53919ea@googlegroups.com> |
| In reply to | #33936 |
Den lördag 2 september 2017 kl. 06:57:47 UTC+2 skrev jonas.t...@gmail.com: > I am writing some string manipulation algorithms that have are heavily branched to hold like say a chessrecords or other similar structured datasets of information. > > Should one index the deep of branch or let the algorithm keep track of the depth using delimiters? > It seem that index will take extra space, but searching the information will be alot faster because the algorithm do not need the to keep track of search depth? > > I do realise that this problem probably implemented in pointer structures and maybe in javascript using arrays with subelements/arrays. > > But i remember doing this type of thing in Basic decades ago, and would check if my brain still up to the task doing it using just string handling. > > Use dataIndex or algorithm counter to keep track of the depth of data in the set? Well i settled for to first try have the algorithm keep track of level and position, but to be able to put in new "moves" or "records" at correct place not only the level is important, it must also know where it is in the structure so a backtrack record "while searching" must always be there. Otherwise you are lost in the structure. So the search algorithm knows where it is in the structure by building the search in memory, it seem simple enough on the surface, we will see how it turn out.
[toc] | [prev] | [next] | [standalone]
| From | jonas.thornvall@gmail.com |
|---|---|
| Date | 2017-09-02 00:34 -0700 |
| Message-ID | <98e08a5a-80ac-4691-8a16-2a24e7502eb4@googlegroups.com> |
| In reply to | #33937 |
Den lördag 2 september 2017 kl. 09:05:38 UTC+2 skrev jonas.t...@gmail.com: > Den lördag 2 september 2017 kl. 06:57:47 UTC+2 skrev jonas.t...@gmail.com: > > I am writing some string manipulation algorithms that have are heavily branched to hold like say a chessrecords or other similar structured datasets of information. > > > > Should one index the deep of branch or let the algorithm keep track of the depth using delimiters? > > It seem that index will take extra space, but searching the information will be alot faster because the algorithm do not need the to keep track of search depth? > > > > I do realise that this problem probably implemented in pointer structures and maybe in javascript using arrays with subelements/arrays. > > > > But i remember doing this type of thing in Basic decades ago, and would check if my brain still up to the task doing it using just string handling. > > > > Use dataIndex or algorithm counter to keep track of the depth of data in the set? > > Well i settled for to first try have the algorithm keep track of level and position, but to be able to put in new "moves" or "records" at correct place not only the level is important, it must also know where it is in the structure so a backtrack record "while searching" must always be there. > > Otherwise you are lost in the structure. So the search algorithm knows where it is in the structure by building the search in memory, it seem simple enough on the surface, we will see how it turn out. I will solve it by having memoryString.charAt(deeplevel)=encodedString.charAt(z); This way the actual built structure while searching always in memory, and can be compared with the structure you want to put in. It could be a chessmove, following from a sequense of chessmoves or a character in a word following from other characters already stored within structure. Is there a name other the branching for these type of tree structures, like to have a dictionary branched using the characters of similar words in a tree structure with just a terminator for finished completed words? So A will only be stored once for every word starting with an A, if the second character is N it will only be stored once? Of course you need delimiters so it could be questionable how much space it actually solves. But the nice thing is you could read in chess games into the structure starting with the first party you can set a weight to the individual move "depending upon if black or white wins" so the first game you read in have 100% =1 for each move of the color that win say white and 0% for each move for the color that lose. After that you weigh "compare" new entries so if next game you read in to the structure so if next game do same 4 moves but after them black wins now the chance of the 4 moves in the chessbook adjusted to 50% but then it branch to 100% for all black moves and so on "of course you need to know how many games each "move at the level represent" to set the weigth "percentage correct". But say you have a few million chess games read into the structure, you could actually tell the chance to win because every move would be weighted against the moves already read in to the structure. So as you read in the games you get a weighted openingbook, without even the need to analyse it further. Does it seem sensible?
[toc] | [prev] | [next] | [standalone]
| From | jonas.thornvall@gmail.com |
|---|---|
| Date | 2017-09-02 07:10 -0700 |
| Message-ID | <5cc7477b-1e70-4d07-aa2d-8bd76b85a200@googlegroups.com> |
| In reply to | #33938 |
Den lördag 2 september 2017 kl. 09:34:17 UTC+2 skrev jonas.t...@gmail.com: > Den lördag 2 september 2017 kl. 09:05:38 UTC+2 skrev jonas.t...@gmail.com: > > Den lördag 2 september 2017 kl. 06:57:47 UTC+2 skrev jonas.t...@gmail.com: > > > I am writing some string manipulation algorithms that have are heavily branched to hold like say a chessrecords or other similar structured datasets of information. > > > > > > Should one index the deep of branch or let the algorithm keep track of the depth using delimiters? > > > It seem that index will take extra space, but searching the information will be alot faster because the algorithm do not need the to keep track of search depth? > > > > > > I do realise that this problem probably implemented in pointer structures and maybe in javascript using arrays with subelements/arrays. > > > > > > But i remember doing this type of thing in Basic decades ago, and would check if my brain still up to the task doing it using just string handling. > > > > > > Use dataIndex or algorithm counter to keep track of the depth of data in the set? > > > > Well i settled for to first try have the algorithm keep track of level and position, but to be able to put in new "moves" or "records" at correct place not only the level is important, it must also know where it is in the structure so a backtrack record "while searching" must always be there. > > > > Otherwise you are lost in the structure. So the search algorithm knows where it is in the structure by building the search in memory, it seem simple enough on the surface, we will see how it turn out. > > I will solve it by having memoryString.charAt(deeplevel)=encodedString.charAt(z); > This way the actual built structure while searching always in memory, and can be compared with the structure you want to put in. > > It could be a chessmove, following from a sequense of chessmoves or a character in a word following from other characters already stored within structure. > > Is there a name other the branching for these type of tree structures, like to have a dictionary branched using the characters of similar words in a tree structure with just a terminator for finished completed words? > > So A will only be stored once for every word starting with an A, if the second character is N it will only be stored once? Of course you need delimiters so it could be questionable how much space it actually solves. > > But the nice thing is you could read in chess games into the structure starting with the first party you can set a weight to the individual move "depending upon if black or white wins" so the first game you read in have 100% =1 for each move of the color that win say white and 0% for each move for the color that lose. > After that you weigh "compare" new entries so if next game you read in to the structure so if next game do same 4 moves but after them black wins now the chance of the 4 moves in the chessbook adjusted to 50% but then it branch to 100% for all black moves and so on "of course you need to know how many games each "move at the level represent" to set the weigth "percentage correct". > > But say you have a few million chess games read into the structure, you could actually tell the chance to win because every move would be weighted against the moves already read in to the structure. > > > So as you read in the games you get a weighted openingbook, without even the need to analyse it further. > > > Does it seem sensible? Been fiddling going direct on the insert did not prove succesfull, this project is going nowhere until i actually can search thru and read out all the words strored. So i will implement a search using a structure created from mind, i think that is the way todo it because the search will just mirror what is read out from the array. It will be a later *easier* problem to actually put things in. Lets see who can first can write an algorithm in head "or javascript ;)" that read out all the words in alpahbetical order. [b[a[l[l*]][n[a[n[a*]]]][t*]][u[n*][t[t*] Is this structure general? Of course the "recurring end" paragraps could be replace with special signs for ]],]]],]]]],]]]]] and so on to save space. I try write a program that search thru structure to begin with, and pick out the words within it. I just did it my head so i may have missed a paragraph. From there you can start to compare with the word you want to read in "and maybe start to insert characters into the structure. Is there a name for this type of branching string datastructure? I mean it does not need to store words, it could store chessgames or whatever branching structure, so it must be known. Well it certainly not a binary tree it is a branching tree, so what is the name?
[toc] | [prev] | [next] | [standalone]
| From | Ben Bacarisse <ben.usenet@bsb.me.uk> |
|---|---|
| Date | 2017-09-02 15:32 +0100 |
| Message-ID | <87r2vpyxuw.fsf@bsb.me.uk> |
| In reply to | #33939 |
jonas.thornvall@gmail.com writes: > Lets see who can first can write an algorithm in head "or javascript > ;)" that read out all the words in alpahbetical order. > > [b[a[l[l*]][n[a[n[a*]]]][t*]][u[n*][t[t*] What does this notation mean? <snip> > Is there a name for this type of branching string datastructure? > I mean it does not need to store words, it could store chessgames or > whatever branching structure, so it must be known. Well it certainly > not a binary tree it is a branching tree, so what is the name? When used for searching, any branching tree is simply called a search tree. There are many much more specific terms depending on how the data are organised in the tree. There are AVL trees, red-black trees, suffix trees and so on. For words, I suspect the one you are looking for is called a trie. I don't think there is a standard name for a tree where the number of possible branches varies depending on where in the tree a node appears (as one might use for chess games). It's just the tree of possible moves. -- Ben.
[toc] | [prev] | [next] | [standalone]
| From | jonas.thornvall@gmail.com |
|---|---|
| Date | 2017-09-02 07:48 -0700 |
| Message-ID | <43ca5e37-5894-4066-8252-b4e560591109@googlegroups.com> |
| In reply to | #33940 |
Den lördag 2 september 2017 kl. 16:33:05 UTC+2 skrev Ben Bacarisse:
> jonas.thornvall@gmail.com writes:
>
> > Lets see who can first can write an algorithm in head "or javascript
> > ;)" that read out all the words in alpahbetical order.
> >
> > [b[a[l[l*]][n[a[n[a*]]]][t*]][u[n*][t[t*]
>
> What does this notation mean?
>
> <snip>
> > Is there a name for this type of branching string datastructure?
> > I mean it does not need to store words, it could store chessgames or
> > whatever branching structure, so it must be known. Well it certainly
> > not a binary tree it is a branching tree, so what is the name?
>
> When used for searching, any branching tree is simply called a search
> tree. There are many much more specific terms depending on how the data
> are organised in the tree. There are AVL trees, red-black trees, suffix
> trees and so on. For words, I suspect the one you are looking for is
> called a trie.
>
> I don't think there is a standard name for a tree where the number of
> possible branches varies depending on where in the tree a node appears
> (as one might use for chess games). It's just the tree of possible
> moves.
>
> --
> Ben.
The notation is used to read in word to a branced structure
"{" character deep ++
"]" character deep --
"*" word termination
[b[a[l[l*]][n[a[n[a*]]]][t*]][u[n*][t[t*]
Words in structure above is read out alphabetical
ball
banana
bat
bun
butt
The principle encode decode for humans pretty simple, a little more thought is required for a script the hardest part is positioning because to read in something you need to know where you are in structure "search it" using level and position.
And to insert new item you probably need to store both the previous item and next item in memory.
[toc] | [prev] | [next] | [standalone]
| From | jonas.thornvall@gmail.com |
|---|---|
| Date | 2017-09-02 08:13 -0700 |
| Message-ID | <e5e0859a-1913-492d-8e5c-0799a4b96723@googlegroups.com> |
| In reply to | #33941 |
Den lördag 2 september 2017 kl. 16:49:08 UTC+2 skrev jonas.t...@gmail.com:
> Den lördag 2 september 2017 kl. 16:33:05 UTC+2 skrev Ben Bacarisse:
> > jonas.thornvall@gmail.com writes:
> >
> > > Lets see who can first can write an algorithm in head "or javascript
> > > ;)" that read out all the words in alpahbetical order.
> > >
> > > [b[a[l[l*]][n[a[n[a*]]]][t*]][u[n*][t[t*]
> >
> > What does this notation mean?
> >
> > <snip>
> > > Is there a name for this type of branching string datastructure?
> > > I mean it does not need to store words, it could store chessgames or
> > > whatever branching structure, so it must be known. Well it certainly
> > > not a binary tree it is a branching tree, so what is the name?
> >
> > When used for searching, any branching tree is simply called a search
> > tree. There are many much more specific terms depending on how the data
> > are organised in the tree. There are AVL trees, red-black trees, suffix
> > trees and so on. For words, I suspect the one you are looking for is
> > called a trie.
> >
> > I don't think there is a standard name for a tree where the number of
> > possible branches varies depending on where in the tree a node appears
> > (as one might use for chess games). It's just the tree of possible
> > moves.
> >
> > --
> > Ben.
>
> The notation is used to read in word to a branced structure
> "{" character deep ++
> "]" character deep --
> "*" word termination
>
> [b[a[l[l*]][n[a[n[a*]]]][t*]][u[n*][t[t*]
>
> Words in structure above is read out alphabetical
> ball
> banana
> bat
> bun
> butt
>
> The principle encode decode for humans pretty simple, a little more thought is required for a script the hardest part is positioning because to read in something you need to know where you are in structure "search it" using level and position.
>
> And to insert new item you probably need to store both the previous item and next item in memory.
I think it could be any string read if i manage to do it correct, i remember slightly doing thins in both basic and Turbo Pascal, it could take some time before i actually get there. But then i could be generalised for any boardgame like chess and go! And since you can weigh the outcome for the games as you read them in you could add probababilities at each "step/move" there is nothing to say "the string read in is a character", it could be any branching of strings basicly.
My original doubts was if i maybe should index the levels for faster search in tree, but i decided to go with a smarter algorithm that know where it is.
1. e4 e5 2. Nf3 Nc6 3. Bb5.
But i decided to keep track of level instead.
[e4 [e5 [ Nf3 [Nc6 [Bc4]]]]] No braches just opening of first chess party we do not know who gonna win yet ;), one probably reserve characters for the weight
~0.5~ after each move will be updated as you read in new games.
Of course if white win first game all his moves will be weighted ~1.0~ and blacks ~0.0~ after you been reading in first game. The rest is just statistics so to say.
[toc] | [prev] | [next] | [standalone]
| From | jonas.thornvall@gmail.com |
|---|---|
| Date | 2017-09-02 08:18 -0700 |
| Message-ID | <d36fb8bc-3d13-4ce5-bfb0-062aabf65a82@googlegroups.com> |
| In reply to | #33942 |
Den lördag 2 september 2017 kl. 17:13:19 UTC+2 skrev jonas.t...@gmail.com:
> Den lördag 2 september 2017 kl. 16:49:08 UTC+2 skrev jonas.t...@gmail.com:
> > Den lördag 2 september 2017 kl. 16:33:05 UTC+2 skrev Ben Bacarisse:
> > > jonas.thornvall@gmail.com writes:
> > >
> > > > Lets see who can first can write an algorithm in head "or javascript
> > > > ;)" that read out all the words in alpahbetical order.
> > > >
> > > > [b[a[l[l*]][n[a[n[a*]]]][t*]][u[n*][t[t*]
> > >
> > > What does this notation mean?
> > >
> > > <snip>
> > > > Is there a name for this type of branching string datastructure?
> > > > I mean it does not need to store words, it could store chessgames or
> > > > whatever branching structure, so it must be known. Well it certainly
> > > > not a binary tree it is a branching tree, so what is the name?
> > >
> > > When used for searching, any branching tree is simply called a search
> > > tree. There are many much more specific terms depending on how the data
> > > are organised in the tree. There are AVL trees, red-black trees, suffix
> > > trees and so on. For words, I suspect the one you are looking for is
> > > called a trie.
> > >
> > > I don't think there is a standard name for a tree where the number of
> > > possible branches varies depending on where in the tree a node appears
> > > (as one might use for chess games). It's just the tree of possible
> > > moves.
> > >
> > > --
> > > Ben.
> >
> > The notation is used to read in word to a branced structure
> > "{" character deep ++
> > "]" character deep --
> > "*" word termination
> >
> > [b[a[l[l*]][n[a[n[a*]]]][t*]][u[n*][t[t*]
> >
> > Words in structure above is read out alphabetical
> > ball
> > banana
> > bat
> > bun
> > butt
> >
> > The principle encode decode for humans pretty simple, a little more thought is required for a script the hardest part is positioning because to read in something you need to know where you are in structure "search it" using level and position.
> >
> > And to insert new item you probably need to store both the previous item and next item in memory.
>
> I think it could be any string read if i manage to do it correct, i remember slightly doing thins in both basic and Turbo Pascal, it could take some time before i actually get there. But then i could be generalised for any boardgame like chess and go! And since you can weigh the outcome for the games as you read them in you could add probababilities at each "step/move" there is nothing to say "the string read in is a character", it could be any branching of strings basicly.
>
> My original doubts was if i maybe should index the levels for faster search in tree, but i decided to go with a smarter algorithm that know where it is.
> 1. e4 e5 2. Nf3 Nc6 3. Bb5.
>
> But i decided to keep track of level instead.
> [e4 [e5 [ Nf3 [Nc6 [Bc4]]]]] No braches just opening of first chess party we do not know who gonna win yet ;), one probably reserve characters for the weight
> ~0.5~ after each move will be updated as you read in new games.
>
> Of course if white win first game all his moves will be weighted ~1.0~ and blacks ~0.0~ after you been reading in first game. The rest is just statistics so to say.
If you want to be pedantic you probably use fractions until all games read in. And then you can roundoff the decimal places.
[toc] | [prev] | [next] | [standalone]
| From | jonas.thornvall@gmail.com |
|---|---|
| Date | 2017-09-02 08:52 -0700 |
| Message-ID | <6d410ea4-fc25-4705-9b93-08b2ac0f6df5@googlegroups.com> |
| In reply to | #33940 |
Den lördag 2 september 2017 kl. 16:33:05 UTC+2 skrev Ben Bacarisse: > jonas.thornvall@gmail.com writes: > > > Lets see who can first can write an algorithm in head "or javascript > > ;)" that read out all the words in alpahbetical order. > > > > [b[a[l[l*]][n[a[n[a*]]]][t*]][u[n*][t[t*] > > What does this notation mean? > > <snip> > > Is there a name for this type of branching string datastructure? > > I mean it does not need to store words, it could store chessgames or > > whatever branching structure, so it must be known. Well it certainly > > not a binary tree it is a branching tree, so what is the name? > > When used for searching, any branching tree is simply called a search > tree. There are many much more specific terms depending on how the data > are organised in the tree. There are AVL trees, red-black trees, suffix > trees and so on. For words, I suspect the one you are looking for is > called a trie. > > I don't think there is a standard name for a tree where the number of > possible branches varies depending on where in the tree a node appears > (as one might use for chess games). It's just the tree of possible > moves. > > -- > Ben. I may forgot to say that you compare the word and its characters you read in *At level* say full previous word is ham and next word is home. The word we want to store is him well level 1 h is already in structure, but on level two we read until next on level 2 that hold "ho" and previous will hold "ha" now it is clear that our level 2 character to insert at second level word "hi" level 2 *i* must be positioned between prev "ha" level 2 "a" and next "ho" level 2 "o". It seem pretty easy at sight but require some fiddling if i remember correct. we are at level 2 next read in
[toc] | [prev] | [next] | [standalone]
| From | jonas.thornvall@gmail.com |
|---|---|
| Date | 2017-09-02 09:42 -0700 |
| Message-ID | <47a63b78-63f5-40c8-b341-fb0357d28c44@googlegroups.com> |
| In reply to | #33940 |
Den lördag 2 september 2017 kl. 16:33:05 UTC+2 skrev Ben Bacarisse: > jonas.thornvall@gmail.com writes: > > > Lets see who can first can write an algorithm in head "or javascript > > ;)" that read out all the words in alpahbetical order. > > > > [b[a[l[l*]][n[a[n[a*]]]][t*]][u[n*][t[t*] > > What does this notation mean? > > <snip> > > Is there a name for this type of branching string datastructure? > > I mean it does not need to store words, it could store chessgames or > > whatever branching structure, so it must be known. Well it certainly > > not a binary tree it is a branching tree, so what is the name? > > When used for searching, any branching tree is simply called a search > tree. There are many much more specific terms depending on how the data > are organised in the tree. There are AVL trees, red-black trees, suffix > trees and so on. For words, I suspect the one you are looking for is > called a trie. > > I don't think there is a standard name for a tree where the number of > possible branches varies depending on where in the tree a node appears > (as one might use for chess games). It's just the tree of possible > moves. > > -- > Ben. You correct Ben it seem to be a trie tree. http://www.geeksforgeeks.org/trie-insert-and-search/
[toc] | [prev] | [next] | [standalone]
| From | jonas.thornvall@gmail.com |
|---|---|
| Date | 2017-09-02 09:54 -0700 |
| Message-ID | <33405e92-8ba3-4da5-9ec8-905d87280e3b@googlegroups.com> |
| In reply to | #33940 |
Den lördag 2 september 2017 kl. 16:33:05 UTC+2 skrev Ben Bacarisse: > jonas.thornvall@gmail.com writes: > > > Lets see who can first can write an algorithm in head "or javascript > > ;)" that read out all the words in alpahbetical order. > > > > [b[a[l[l*]][n[a[n[a*]]]][t*]][u[n*][t[t*] > > What does this notation mean? > > <snip> > > Is there a name for this type of branching string datastructure? > > I mean it does not need to store words, it could store chessgames or > > whatever branching structure, so it must be known. Well it certainly > > not a binary tree it is a branching tree, so what is the name? > > When used for searching, any branching tree is simply called a search > tree. There are many much more specific terms depending on how the data > are organised in the tree. There are AVL trees, red-black trees, suffix > trees and so on. For words, I suspect the one you are looking for is > called a trie. > > I don't think there is a standard name for a tree where the number of > possible branches varies depending on where in the tree a node appears > (as one might use for chess games). It's just the tree of possible > moves. > > -- > Ben. Are trie trees used in AI development Ben, it seem easy to weigh the outcome as you read in "trials"? Well i am going for an algorithm working on simple string with the advantage it can be saved down to file without any formatting "beside creation". What is the most efficient way in javascript, can you branch arrays? But then you have the hussle to format and store them and read them in? Here just the blob saved, i kind of like that but i guess performance wise it is hardly optimal to use a sting especially if it not indexed with levels?
[toc] | [prev] | [next] | [standalone]
| From | jonas.thornvall@gmail.com |
|---|---|
| Date | 2017-09-02 10:17 -0700 |
| Message-ID | <0e2c7669-2235-4984-8e71-cdd058da0b42@googlegroups.com> |
| In reply to | #33946 |
Den lördag 2 september 2017 kl. 18:54:41 UTC+2 skrev jonas.t...@gmail.com: > Den lördag 2 september 2017 kl. 16:33:05 UTC+2 skrev Ben Bacarisse: > > jonas.thornvall@gmail.com writes: > > > > > Lets see who can first can write an algorithm in head "or javascript > > > ;)" that read out all the words in alpahbetical order. > > > > > > [b[a[l[l*]][n[a[n[a*]]]][t*]][u[n*][t[t*] > > > > What does this notation mean? > > > > <snip> > > > Is there a name for this type of branching string datastructure? > > > I mean it does not need to store words, it could store chessgames or > > > whatever branching structure, so it must be known. Well it certainly > > > not a binary tree it is a branching tree, so what is the name? > > > > When used for searching, any branching tree is simply called a search > > tree. There are many much more specific terms depending on how the data > > are organised in the tree. There are AVL trees, red-black trees, suffix > > trees and so on. For words, I suspect the one you are looking for is > > called a trie. > > > > I don't think there is a standard name for a tree where the number of > > possible branches varies depending on where in the tree a node appears > > (as one might use for chess games). It's just the tree of possible > > moves. > > > > -- > > Ben. > > Are trie trees used in AI development Ben, it seem easy to weigh the outcome as you read in "trials"? Well i am going for an algorithm working on simple string with the advantage it can be saved down to file without any formatting "beside creation". > > What is the most efficient way in javascript, can you branch arrays? But then you have the hussle to format and store them and read them in? Here just the blob saved, i kind of like that but i guess performance wise it is hardly optimal to use a sting especially if it not indexed with levels? Well i may make a version using indexed levels instead once i finished the one with delimiters just to see how they compare.
[toc] | [prev] | [next] | [standalone]
| From | jonas.thornvall@gmail.com |
|---|---|
| Date | 2017-09-03 13:41 -0700 |
| Message-ID | <35deda5c-0db6-4cd8-8e3c-788141d13f13@googlegroups.com> |
| In reply to | #33947 |
Den lördag 2 september 2017 kl. 19:17:26 UTC+2 skrev jonas.t...@gmail.com: > Den lördag 2 september 2017 kl. 18:54:41 UTC+2 skrev jonas.t...@gmail.com: > > Den lördag 2 september 2017 kl. 16:33:05 UTC+2 skrev Ben Bacarisse: > > > jonas.thornvall@gmail.com writes: > > > > > > > Lets see who can first can write an algorithm in head "or javascript > > > > ;)" that read out all the words in alpahbetical order. > > > > > > > > [b[a[l[l*]][n[a[n[a*]]]][t*]][u[n*][t[t*] > > > > > > What does this notation mean? > > > > > > <snip> > > > > Is there a name for this type of branching string datastructure? > > > > I mean it does not need to store words, it could store chessgames or > > > > whatever branching structure, so it must be known. Well it certainly > > > > not a binary tree it is a branching tree, so what is the name? > > > > > > When used for searching, any branching tree is simply called a search > > > tree. There are many much more specific terms depending on how the data > > > are organised in the tree. There are AVL trees, red-black trees, suffix > > > trees and so on. For words, I suspect the one you are looking for is > > > called a trie. > > > > > > I don't think there is a standard name for a tree where the number of > > > possible branches varies depending on where in the tree a node appears > > > (as one might use for chess games). It's just the tree of possible > > > moves. > > > > > > -- > > > Ben. > > > > Are trie trees used in AI development Ben, it seem easy to weigh the outcome as you read in "trials"? Well i am going for an algorithm working on simple string with the advantage it can be saved down to file without any formatting "beside creation". > > > > What is the most efficient way in javascript, can you branch arrays? But then you have the hussle to format and store them and read them in? Here just the blob saved, i kind of like that but i guess performance wise it is hardly optimal to use a sting especially if it not indexed with levels? > > Well i may make a version using indexed levels instead once i finished the one with delimiters just to see how they compare. Just finished the algorithm to read thru string structure and i think i have all vital values to insert a new stringitem. Apparently there will be two special cases inserts before and after the string structure.
[toc] | [prev] | [next] | [standalone]
| From | jonas.thornvall@gmail.com |
|---|---|
| Date | 2017-09-03 13:58 -0700 |
| Message-ID | <ffea6b31-8b0d-47c0-95b2-a5f51f5df8f3@googlegroups.com> |
| In reply to | #33956 |
Den söndag 3 september 2017 kl. 22:41:52 UTC+2 skrev jonas.t...@gmail.com:
> Den lördag 2 september 2017 kl. 19:17:26 UTC+2 skrev jonas.t...@gmail.com:
> > Den lördag 2 september 2017 kl. 18:54:41 UTC+2 skrev jonas.t...@gmail.com:
> > > Den lördag 2 september 2017 kl. 16:33:05 UTC+2 skrev Ben Bacarisse:
> > > > jonas.thornvall@gmail.com writes:
> > > >
> > > > > Lets see who can first can write an algorithm in head "or javascript
> > > > > ;)" that read out all the words in alpahbetical order.
> > > > >
> > > > > [b[a[l[l*]][n[a[n[a*]]]][t*]][u[n*][t[t*]
> > > >
> > > > What does this notation mean?
> > > >
> > > > <snip>
> > > > > Is there a name for this type of branching string datastructure?
> > > > > I mean it does not need to store words, it could store chessgames or
> > > > > whatever branching structure, so it must be known. Well it certainly
> > > > > not a binary tree it is a branching tree, so what is the name?
> > > >
> > > > When used for searching, any branching tree is simply called a search
> > > > tree. There are many much more specific terms depending on how the data
> > > > are organised in the tree. There are AVL trees, red-black trees, suffix
> > > > trees and so on. For words, I suspect the one you are looking for is
> > > > called a trie.
> > > >
> > > > I don't think there is a standard name for a tree where the number of
> > > > possible branches varies depending on where in the tree a node appears
> > > > (as one might use for chess games). It's just the tree of possible
> > > > moves.
> > > >
> > > > --
> > > > Ben.
> > >
> > > Are trie trees used in AI development Ben, it seem easy to weigh the outcome as you read in "trials"? Well i am going for an algorithm working on simple string with the advantage it can be saved down to file without any formatting "beside creation".
> > >
> > > What is the most efficient way in javascript, can you branch arrays? But then you have the hussle to format and store them and read them in? Here just the blob saved, i kind of like that but i guess performance wise it is hardly optimal to use a sting especially if it not indexed with levels?
> >
> > Well i may make a version using indexed levels instead once i finished the one with delimiters just to see how they compare.
>
> Just finished the algorithm to read thru string structure and i think i have all vital values to insert a new stringitem.
>
> Apparently there will be two special cases inserts before and after the string structure.
This will just read out the words from the string structure.
But it will definitly make it easier to position to put in new words character by character into structure.
[b[a[l[l*]][n[a[n[a*]]]][t*]][u[n*][t[t*]
function searchReadThru() {
for (z = 0; z < encodedString.length; z++) {
if (encodedString.charAt(z) == "[") {
oldlevel=deeplevel;
deeplevel++;
alert("Level added"+deeplevel+" "+oldlevel+" "+stringNextMem);
} else if (encodedString.charAt(z) == "]") {
oldlevel=deeplevel;
deeplevel--;
stringNextMem = stringNextMem.slice(0, -1);
alert("Level revoked "+deeplevel+" "+oldlevel+" "+stringNextMem);
} else if (encodedString.charAt(z) == "*") {
alert("End word "+deeplevel+" "+oldlevel+" "+stringNextMem);
} else {
stringPrevMem = stringNextMem;
stringNextMem += encodedString.charAt(z);
alert("Newchar "+deeplevel+" "+oldlevel+" "+stringNextMem);
}
}
}
[toc] | [prev] | [next] | [standalone]
| From | jonas.thornvall@gmail.com |
|---|---|
| Date | 2017-09-03 14:09 -0700 |
| Message-ID | <417b2c13-df89-4660-b552-fe35f9d6a401@googlegroups.com> |
| In reply to | #33957 |
Den söndag 3 september 2017 kl. 22:58:50 UTC+2 skrev jonas.t...@gmail.com:
> Den söndag 3 september 2017 kl. 22:41:52 UTC+2 skrev jonas.t...@gmail.com:
> > Den lördag 2 september 2017 kl. 19:17:26 UTC+2 skrev jonas.t...@gmail.com:
> > > Den lördag 2 september 2017 kl. 18:54:41 UTC+2 skrev jonas.t...@gmail.com:
> > > > Den lördag 2 september 2017 kl. 16:33:05 UTC+2 skrev Ben Bacarisse:
> > > > > jonas.thornvall@gmail.com writes:
> > > > >
> > > > > > Lets see who can first can write an algorithm in head "or javascript
> > > > > > ;)" that read out all the words in alpahbetical order.
> > > > > >
> > > > > > [b[a[l[l*]][n[a[n[a*]]]][t*]][u[n*][t[t*]
> > > > >
> > > > > What does this notation mean?
> > > > >
> > > > > <snip>
> > > > > > Is there a name for this type of branching string datastructure?
> > > > > > I mean it does not need to store words, it could store chessgames or
> > > > > > whatever branching structure, so it must be known. Well it certainly
> > > > > > not a binary tree it is a branching tree, so what is the name?
> > > > >
> > > > > When used for searching, any branching tree is simply called a search
> > > > > tree. There are many much more specific terms depending on how the data
> > > > > are organised in the tree. There are AVL trees, red-black trees, suffix
> > > > > trees and so on. For words, I suspect the one you are looking for is
> > > > > called a trie.
> > > > >
> > > > > I don't think there is a standard name for a tree where the number of
> > > > > possible branches varies depending on where in the tree a node appears
> > > > > (as one might use for chess games). It's just the tree of possible
> > > > > moves.
> > > > >
> > > > > --
> > > > > Ben.
> > > >
> > > > Are trie trees used in AI development Ben, it seem easy to weigh the outcome as you read in "trials"? Well i am going for an algorithm working on simple string with the advantage it can be saved down to file without any formatting "beside creation".
> > > >
> > > > What is the most efficient way in javascript, can you branch arrays? But then you have the hussle to format and store them and read them in? Here just the blob saved, i kind of like that but i guess performance wise it is hardly optimal to use a sting especially if it not indexed with levels?
> > >
> > > Well i may make a version using indexed levels instead once i finished the one with delimiters just to see how they compare.
> >
> > Just finished the algorithm to read thru string structure and i think i have all vital values to insert a new stringitem.
> >
> > Apparently there will be two special cases inserts before and after the string structure.
>
> This will just read out the words from the string structure.
> But it will definitly make it easier to position to put in new words character by character into structure.
>
> [b[a[l[l*]][n[a[n[a*]]]][t*]][u[n*][t[t*]
>
> function searchReadThru() {
> for (z = 0; z < encodedString.length; z++) {
> if (encodedString.charAt(z) == "[") {
> oldlevel=deeplevel;
> deeplevel++;
> alert("Level added"+deeplevel+" "+oldlevel+" "+stringNextMem);
> } else if (encodedString.charAt(z) == "]") {
> oldlevel=deeplevel;
> deeplevel--;
> stringNextMem = stringNextMem.slice(0, -1);
> alert("Level revoked "+deeplevel+" "+oldlevel+" "+stringNextMem);
> } else if (encodedString.charAt(z) == "*") {
> alert("End word "+deeplevel+" "+oldlevel+" "+stringNextMem);
> } else {
> stringPrevMem = stringNextMem;
> stringNextMem += encodedString.charAt(z);
> alert("Newchar "+deeplevel+" "+oldlevel+" "+stringNextMem);
> }
Any new item i guess would be inserted here or?
insertItem();
-
> }
> }
[toc] | [prev] | [next] | [standalone]
| From | jonas.thornvall@gmail.com |
|---|---|
| Date | 2017-09-03 14:17 -0700 |
| Message-ID | <d8c07033-14ef-42cc-8963-0dad5f7b4789@googlegroups.com> |
| In reply to | #33958 |
Den söndag 3 september 2017 kl. 23:09:27 UTC+2 skrev jonas.t...@gmail.com:
> Den söndag 3 september 2017 kl. 22:58:50 UTC+2 skrev jonas.t...@gmail.com:
> > Den söndag 3 september 2017 kl. 22:41:52 UTC+2 skrev jonas.t...@gmail.com:
> > > Den lördag 2 september 2017 kl. 19:17:26 UTC+2 skrev jonas.t...@gmail.com:
> > > > Den lördag 2 september 2017 kl. 18:54:41 UTC+2 skrev jonas.t...@gmail.com:
> > > > > Den lördag 2 september 2017 kl. 16:33:05 UTC+2 skrev Ben Bacarisse:
> > > > > > jonas.thornvall@gmail.com writes:
> > > > > >
> > > > > > > Lets see who can first can write an algorithm in head "or javascript
> > > > > > > ;)" that read out all the words in alpahbetical order.
> > > > > > >
> > > > > > > [b[a[l[l*]][n[a[n[a*]]]][t*]][u[n*][t[t*]
> > > > > >
> > > > > > What does this notation mean?
> > > > > >
> > > > > > <snip>
> > > > > > > Is there a name for this type of branching string datastructure?
> > > > > > > I mean it does not need to store words, it could store chessgames or
> > > > > > > whatever branching structure, so it must be known. Well it certainly
> > > > > > > not a binary tree it is a branching tree, so what is the name?
> > > > > >
> > > > > > When used for searching, any branching tree is simply called a search
> > > > > > tree. There are many much more specific terms depending on how the data
> > > > > > are organised in the tree. There are AVL trees, red-black trees, suffix
> > > > > > trees and so on. For words, I suspect the one you are looking for is
> > > > > > called a trie.
> > > > > >
> > > > > > I don't think there is a standard name for a tree where the number of
> > > > > > possible branches varies depending on where in the tree a node appears
> > > > > > (as one might use for chess games). It's just the tree of possible
> > > > > > moves.
> > > > > >
> > > > > > --
> > > > > > Ben.
> > > > >
> > > > > Are trie trees used in AI development Ben, it seem easy to weigh the outcome as you read in "trials"? Well i am going for an algorithm working on simple string with the advantage it can be saved down to file without any formatting "beside creation".
> > > > >
> > > > > What is the most efficient way in javascript, can you branch arrays? But then you have the hussle to format and store them and read them in? Here just the blob saved, i kind of like that but i guess performance wise it is hardly optimal to use a sting especially if it not indexed with levels?
> > > >
> > > > Well i may make a version using indexed levels instead once i finished the one with delimiters just to see how they compare.
> > >
> > > Just finished the algorithm to read thru string structure and i think i have all vital values to insert a new stringitem.
> > >
> > > Apparently there will be two special cases inserts before and after the string structure.
> >
> > This will just read out the words from the string structure.
> > But it will definitly make it easier to position to put in new words character by character into structure.
> >
> > [b[a[l[l*]][n[a[n[a*]]]][t*]][u[n*][t[t*]
> >
> > function searchReadThru() {
> > for (z = 0; z < encodedString.length; z++) {
> > if (encodedString.charAt(z) == "[") {
> > oldlevel=deeplevel;
> > deeplevel++;
> > alert("Level added"+deeplevel+" "+oldlevel+" "+stringNextMem);
> > } else if (encodedString.charAt(z) == "]") {
> > oldlevel=deeplevel;
> > deeplevel--;
> > stringNextMem = stringNextMem.slice(0, -1);
> > alert("Level revoked "+deeplevel+" "+oldlevel+" "+stringNextMem);
> > } else if (encodedString.charAt(z) == "*") {
> > alert("End word "+deeplevel+" "+oldlevel+" "+stringNextMem);
> > } else {
> > stringPrevMem = stringNextMem;
> > stringNextMem += encodedString.charAt(z);
> > alert("Newchar "+deeplevel+" "+oldlevel+" "+stringNextMem);
> > }
>
> Any new item i guess would be inserted here or?
> insertItem();
Well any new check for in correct position to insert, so..
if (encodedString.charAt(z) != "[" && encodedString.charAt(z) != "]" && encodedString.charAt(z) != "*") checkIfInsert();
There is probably technics to search in alot faster for right spot then linear progression thru the string "if it is a big file"...
But it is a start.
> -
> > }
> > }
[toc] | [prev] | [next] | [standalone]
| From | jonas.thornvall@gmail.com |
|---|---|
| Date | 2017-09-03 14:33 -0700 |
| Message-ID | <fcabd63a-92d7-42a0-9370-38b31bea162d@googlegroups.com> |
| In reply to | #33959 |
Den söndag 3 september 2017 kl. 23:17:50 UTC+2 skrev jonas.t...@gmail.com:
> Den söndag 3 september 2017 kl. 23:09:27 UTC+2 skrev jonas.t...@gmail.com:
> > Den söndag 3 september 2017 kl. 22:58:50 UTC+2 skrev jonas.t...@gmail.com:
> > > Den söndag 3 september 2017 kl. 22:41:52 UTC+2 skrev jonas.t...@gmail.com:
> > > > Den lördag 2 september 2017 kl. 19:17:26 UTC+2 skrev jonas.t...@gmail.com:
> > > > > Den lördag 2 september 2017 kl. 18:54:41 UTC+2 skrev jonas.t...@gmail.com:
> > > > > > Den lördag 2 september 2017 kl. 16:33:05 UTC+2 skrev Ben Bacarisse:
> > > > > > > jonas.thornvall@gmail.com writes:
> > > > > > >
> > > > > > > > Lets see who can first can write an algorithm in head "or javascript
> > > > > > > > ;)" that read out all the words in alpahbetical order.
> > > > > > > >
> > > > > > > > [b[a[l[l*]][n[a[n[a*]]]][t*]][u[n*][t[t*]
> > > > > > >
> > > > > > > What does this notation mean?
> > > > > > >
> > > > > > > <snip>
> > > > > > > > Is there a name for this type of branching string datastructure?
> > > > > > > > I mean it does not need to store words, it could store chessgames or
> > > > > > > > whatever branching structure, so it must be known. Well it certainly
> > > > > > > > not a binary tree it is a branching tree, so what is the name?
> > > > > > >
> > > > > > > When used for searching, any branching tree is simply called a search
> > > > > > > tree. There are many much more specific terms depending on how the data
> > > > > > > are organised in the tree. There are AVL trees, red-black trees, suffix
> > > > > > > trees and so on. For words, I suspect the one you are looking for is
> > > > > > > called a trie.
> > > > > > >
> > > > > > > I don't think there is a standard name for a tree where the number of
> > > > > > > possible branches varies depending on where in the tree a node appears
> > > > > > > (as one might use for chess games). It's just the tree of possible
> > > > > > > moves.
> > > > > > >
> > > > > > > --
> > > > > > > Ben.
> > > > > >
> > > > > > Are trie trees used in AI development Ben, it seem easy to weigh the outcome as you read in "trials"? Well i am going for an algorithm working on simple string with the advantage it can be saved down to file without any formatting "beside creation".
> > > > > >
> > > > > > What is the most efficient way in javascript, can you branch arrays? But then you have the hussle to format and store them and read them in? Here just the blob saved, i kind of like that but i guess performance wise it is hardly optimal to use a sting especially if it not indexed with levels?
> > > > >
> > > > > Well i may make a version using indexed levels instead once i finished the one with delimiters just to see how they compare.
> > > >
> > > > Just finished the algorithm to read thru string structure and i think i have all vital values to insert a new stringitem.
> > > >
> > > > Apparently there will be two special cases inserts before and after the string structure.
> > >
> > > This will just read out the words from the string structure.
> > > But it will definitly make it easier to position to put in new words character by character into structure.
> > >
> > > [b[a[l[l*]][n[a[n[a*]]]][t*]][u[n*][t[t*]
> > >
> > > function searchReadThru() {
> > > for (z = 0; z < encodedString.length; z++) {
> > > if (encodedString.charAt(z) == "[") {
> > > oldlevel=deeplevel;
> > > deeplevel++;
> > > alert("Level added"+deeplevel+" "+oldlevel+" "+stringNextMem);
> > > } else if (encodedString.charAt(z) == "]") {
> > > oldlevel=deeplevel;
> > > deeplevel--;
> > > stringNextMem = stringNextMem.slice(0, -1);
> > > alert("Level revoked "+deeplevel+" "+oldlevel+" "+stringNextMem);
> > > } else if (encodedString.charAt(z) == "*") {
> > > alert("End word "+deeplevel+" "+oldlevel+" "+stringNextMem);
> > > } else {
> > > stringPrevMem = stringNextMem;
> > > stringNextMem += encodedString.charAt(z);
> > > alert("Newchar "+deeplevel+" "+oldlevel+" "+stringNextMem);
> > > }
> >
> > Any new item i guess would be inserted here or?
> > insertItem();
>
> Well any new check for in correct position to insert, so..
>
> if (encodedString.charAt(z) != "[" && encodedString.charAt(z) != "]" && encodedString.charAt(z) != "*") checkIfInsert();
>
> There is probably technics to search in alot faster for right spot then linear progression thru the string "if it is a big file"...
>
> But it is a start.
>
>
> > -
> > > }
> > > }
But for most games and board games like chess the number of openings is limited so if you read in board games linear progression will work good for inserts, i see there is about 12-15 in chess.
[toc] | [prev] | [next] | [standalone]
| From | jonas.thornvall@gmail.com |
|---|---|
| Date | 2017-09-05 01:33 -0700 |
| Message-ID | <a8da56cd-471a-452b-8d74-b74e94f74538@googlegroups.com> |
| In reply to | #33960 |
Den söndag 3 september 2017 kl. 23:33:09 UTC+2 skrev jonas.t...@gmail.com:
> Den söndag 3 september 2017 kl. 23:17:50 UTC+2 skrev jonas.t...@gmail.com:
> > Den söndag 3 september 2017 kl. 23:09:27 UTC+2 skrev jonas.t...@gmail.com:
> > > Den söndag 3 september 2017 kl. 22:58:50 UTC+2 skrev jonas.t...@gmail.com:
> > > > Den söndag 3 september 2017 kl. 22:41:52 UTC+2 skrev jonas.t...@gmail.com:
> > > > > Den lördag 2 september 2017 kl. 19:17:26 UTC+2 skrev jonas.t...@gmail.com:
> > > > > > Den lördag 2 september 2017 kl. 18:54:41 UTC+2 skrev jonas.t...@gmail.com:
> > > > > > > Den lördag 2 september 2017 kl. 16:33:05 UTC+2 skrev Ben Bacarisse:
> > > > > > > > jonas.thornvall@gmail.com writes:
> > > > > > > >
> > > > > > > > > Lets see who can first can write an algorithm in head "or javascript
> > > > > > > > > ;)" that read out all the words in alpahbetical order.
> > > > > > > > >
> > > > > > > > > [b[a[l[l*]][n[a[n[a*]]]][t*]][u[n*][t[t*]
> > > > > > > >
> > > > > > > > What does this notation mean?
> > > > > > > >
> > > > > > > > <snip>
> > > > > > > > > Is there a name for this type of branching string datastructure?
> > > > > > > > > I mean it does not need to store words, it could store chessgames or
> > > > > > > > > whatever branching structure, so it must be known. Well it certainly
> > > > > > > > > not a binary tree it is a branching tree, so what is the name?
> > > > > > > >
> > > > > > > > When used for searching, any branching tree is simply called a search
> > > > > > > > tree. There are many much more specific terms depending on how the data
> > > > > > > > are organised in the tree. There are AVL trees, red-black trees, suffix
> > > > > > > > trees and so on. For words, I suspect the one you are looking for is
> > > > > > > > called a trie.
> > > > > > > >
> > > > > > > > I don't think there is a standard name for a tree where the number of
> > > > > > > > possible branches varies depending on where in the tree a node appears
> > > > > > > > (as one might use for chess games). It's just the tree of possible
> > > > > > > > moves.
> > > > > > > >
> > > > > > > > --
> > > > > > > > Ben.
> > > > > > >
> > > > > > > Are trie trees used in AI development Ben, it seem easy to weigh the outcome as you read in "trials"? Well i am going for an algorithm working on simple string with the advantage it can be saved down to file without any formatting "beside creation".
> > > > > > >
> > > > > > > What is the most efficient way in javascript, can you branch arrays? But then you have the hussle to format and store them and read them in? Here just the blob saved, i kind of like that but i guess performance wise it is hardly optimal to use a sting especially if it not indexed with levels?
> > > > > >
> > > > > > Well i may make a version using indexed levels instead once i finished the one with delimiters just to see how they compare.
> > > > >
> > > > > Just finished the algorithm to read thru string structure and i think i have all vital values to insert a new stringitem.
> > > > >
> > > > > Apparently there will be two special cases inserts before and after the string structure.
> > > >
> > > > This will just read out the words from the string structure.
> > > > But it will definitly make it easier to position to put in new words character by character into structure.
> > > >
> > > > [b[a[l[l*]][n[a[n[a*]]]][t*]][u[n*][t[t*]
> > > >
> > > > function searchReadThru() {
> > > > for (z = 0; z < encodedString.length; z++) {
> > > > if (encodedString.charAt(z) == "[") {
> > > > oldlevel=deeplevel;
> > > > deeplevel++;
> > > > alert("Level added"+deeplevel+" "+oldlevel+" "+stringNextMem);
> > > > } else if (encodedString.charAt(z) == "]") {
> > > > oldlevel=deeplevel;
> > > > deeplevel--;
> > > > stringNextMem = stringNextMem.slice(0, -1);
> > > > alert("Level revoked "+deeplevel+" "+oldlevel+" "+stringNextMem);
> > > > } else if (encodedString.charAt(z) == "*") {
> > > > alert("End word "+deeplevel+" "+oldlevel+" "+stringNextMem);
> > > > } else {
> > > > stringPrevMem = stringNextMem;
> > > > stringNextMem += encodedString.charAt(z);
> > > > alert("Newchar "+deeplevel+" "+oldlevel+" "+stringNextMem);
> > > > }
> > >
> > > Any new item i guess would be inserted here or?
> > > insertItem();
> >
> > Well any new check for in correct position to insert, so..
> >
> > if (encodedString.charAt(z) != "[" && encodedString.charAt(z) != "]" && encodedString.charAt(z) != "*") checkIfInsert();
> >
> > There is probably technics to search in alot faster for right spot then linear progression thru the string "if it is a big file"...
> >
> > But it is a start.
> >
> >
> > > -
> > > > }
> > > > }
>
> But for most games and board games like chess the number of openings is limited so if you read in board games linear progression will work good for inserts, i see there is about 12-15 in chess.
A bit further i think i managed to position the and readout the input string so that it develop and follow the structure already in place and find the spot where the substring "character by character" readout structure get bigger then the readin substring, well the place todo the insert.
Now it is just a matter of howto format the input string with brackets there could be a few cases.
[toc] | [prev] | [next] | [standalone]
| From | jonas.thornvall@gmail.com |
|---|---|
| Date | 2017-09-15 18:05 -0700 |
| Message-ID | <e3bcb698-70b4-43d0-9949-8e9170893dbf@googlegroups.com> |
| In reply to | #33961 |
Den tisdag 5 september 2017 kl. 10:33:14 UTC+2 skrev jonas.t...@gmail.com:
> Den söndag 3 september 2017 kl. 23:33:09 UTC+2 skrev jonas.t...@gmail.com:
> > Den söndag 3 september 2017 kl. 23:17:50 UTC+2 skrev jonas.t...@gmail.com:
> > > Den söndag 3 september 2017 kl. 23:09:27 UTC+2 skrev jonas.t...@gmail.com:
> > > > Den söndag 3 september 2017 kl. 22:58:50 UTC+2 skrev jonas.t...@gmail.com:
> > > > > Den söndag 3 september 2017 kl. 22:41:52 UTC+2 skrev jonas.t...@gmail.com:
> > > > > > Den lördag 2 september 2017 kl. 19:17:26 UTC+2 skrev jonas.t...@gmail.com:
> > > > > > > Den lördag 2 september 2017 kl. 18:54:41 UTC+2 skrev jonas.t...@gmail.com:
> > > > > > > > Den lördag 2 september 2017 kl. 16:33:05 UTC+2 skrev Ben Bacarisse:
> > > > > > > > > jonas.thornvall@gmail.com writes:
> > > > > > > > >
> > > > > > > > > > Lets see who can first can write an algorithm in head "or javascript
> > > > > > > > > > ;)" that read out all the words in alpahbetical order.
> > > > > > > > > >
> > > > > > > > > > [b[a[l[l*]][n[a[n[a*]]]][t*]][u[n*][t[t*]
> > > > > > > > >
> > > > > > > > > What does this notation mean?
> > > > > > > > >
> > > > > > > > > <snip>
> > > > > > > > > > Is there a name for this type of branching string datastructure?
> > > > > > > > > > I mean it does not need to store words, it could store chessgames or
> > > > > > > > > > whatever branching structure, so it must be known. Well it certainly
> > > > > > > > > > not a binary tree it is a branching tree, so what is the name?
> > > > > > > > >
> > > > > > > > > When used for searching, any branching tree is simply called a search
> > > > > > > > > tree. There are many much more specific terms depending on how the data
> > > > > > > > > are organised in the tree. There are AVL trees, red-black trees, suffix
> > > > > > > > > trees and so on. For words, I suspect the one you are looking for is
> > > > > > > > > called a trie.
> > > > > > > > >
> > > > > > > > > I don't think there is a standard name for a tree where the number of
> > > > > > > > > possible branches varies depending on where in the tree a node appears
> > > > > > > > > (as one might use for chess games). It's just the tree of possible
> > > > > > > > > moves.
> > > > > > > > >
> > > > > > > > > --
> > > > > > > > > Ben.
> > > > > > > >
> > > > > > > > Are trie trees used in AI development Ben, it seem easy to weigh the outcome as you read in "trials"? Well i am going for an algorithm working on simple string with the advantage it can be saved down to file without any formatting "beside creation".
> > > > > > > >
> > > > > > > > What is the most efficient way in javascript, can you branch arrays? But then you have the hussle to format and store them and read them in? Here just the blob saved, i kind of like that but i guess performance wise it is hardly optimal to use a sting especially if it not indexed with levels?
> > > > > > >
> > > > > > > Well i may make a version using indexed levels instead once i finished the one with delimiters just to see how they compare.
> > > > > >
> > > > > > Just finished the algorithm to read thru string structure and i think i have all vital values to insert a new stringitem.
> > > > > >
> > > > > > Apparently there will be two special cases inserts before and after the string structure.
> > > > >
> > > > > This will just read out the words from the string structure.
> > > > > But it will definitly make it easier to position to put in new words character by character into structure.
> > > > >
> > > > > [b[a[l[l*]][n[a[n[a*]]]][t*]][u[n*][t[t*]
> > > > >
> > > > > function searchReadThru() {
> > > > > for (z = 0; z < encodedString.length; z++) {
> > > > > if (encodedString.charAt(z) == "[") {
> > > > > oldlevel=deeplevel;
> > > > > deeplevel++;
> > > > > alert("Level added"+deeplevel+" "+oldlevel+" "+stringNextMem);
> > > > > } else if (encodedString.charAt(z) == "]") {
> > > > > oldlevel=deeplevel;
> > > > > deeplevel--;
> > > > > stringNextMem = stringNextMem.slice(0, -1);
> > > > > alert("Level revoked "+deeplevel+" "+oldlevel+" "+stringNextMem);
> > > > > } else if (encodedString.charAt(z) == "*") {
> > > > > alert("End word "+deeplevel+" "+oldlevel+" "+stringNextMem);
> > > > > } else {
> > > > > stringPrevMem = stringNextMem;
> > > > > stringNextMem += encodedString.charAt(z);
> > > > > alert("Newchar "+deeplevel+" "+oldlevel+" "+stringNextMem);
> > > > > }
> > > >
> > > > Any new item i guess would be inserted here or?
> > > > insertItem();
> > >
> > > Well any new check for in correct position to insert, so..
> > >
> > > if (encodedString.charAt(z) != "[" && encodedString.charAt(z) != "]" && encodedString.charAt(z) != "*") checkIfInsert();
> > >
> > > There is probably technics to search in alot faster for right spot then linear progression thru the string "if it is a big file"...
> > >
> > > But it is a start.
> > >
> > >
> > > > -
> > > > > }
> > > > > }
> >
> > But for most games and board games like chess the number of openings is limited so if you read in board games linear progression will work good for inserts, i see there is about 12-15 in chess.
>
> A bit further i think i managed to position the and readout the input string so that it develop and follow the structure already in place and find the spot where the substring "character by character" readout structure get bigger then the readin substring, well the place todo the insert.
>
> Now it is just a matter of howto format the input string with brackets there could be a few cases.
My ideas so good they are 30 years old.
https://www.youtube.com/watch?v=Bm7zah_LrmE
[toc] | [prev] | [next] | [standalone]
| From | jonas.thornvall@gmail.com |
|---|---|
| Date | 2017-09-15 18:06 -0700 |
| Message-ID | <29c05e81-eca7-4770-a95a-72cefdf6a1e2@googlegroups.com> |
| In reply to | #33988 |
Den lördag 16 september 2017 kl. 03:05:33 UTC+2 skrev jonas.t...@gmail.com:
> Den tisdag 5 september 2017 kl. 10:33:14 UTC+2 skrev jonas.t...@gmail.com:
> > Den söndag 3 september 2017 kl. 23:33:09 UTC+2 skrev jonas.t...@gmail.com:
> > > Den söndag 3 september 2017 kl. 23:17:50 UTC+2 skrev jonas.t...@gmail.com:
> > > > Den söndag 3 september 2017 kl. 23:09:27 UTC+2 skrev jonas.t...@gmail.com:
> > > > > Den söndag 3 september 2017 kl. 22:58:50 UTC+2 skrev jonas.t...@gmail.com:
> > > > > > Den söndag 3 september 2017 kl. 22:41:52 UTC+2 skrev jonas.t...@gmail.com:
> > > > > > > Den lördag 2 september 2017 kl. 19:17:26 UTC+2 skrev jonas.t...@gmail.com:
> > > > > > > > Den lördag 2 september 2017 kl. 18:54:41 UTC+2 skrev jonas.t...@gmail.com:
> > > > > > > > > Den lördag 2 september 2017 kl. 16:33:05 UTC+2 skrev Ben Bacarisse:
> > > > > > > > > > jonas.thornvall@gmail.com writes:
> > > > > > > > > >
> > > > > > > > > > > Lets see who can first can write an algorithm in head "or javascript
> > > > > > > > > > > ;)" that read out all the words in alpahbetical order.
> > > > > > > > > > >
> > > > > > > > > > > [b[a[l[l*]][n[a[n[a*]]]][t*]][u[n*][t[t*]
> > > > > > > > > >
> > > > > > > > > > What does this notation mean?
> > > > > > > > > >
> > > > > > > > > > <snip>
> > > > > > > > > > > Is there a name for this type of branching string datastructure?
> > > > > > > > > > > I mean it does not need to store words, it could store chessgames or
> > > > > > > > > > > whatever branching structure, so it must be known. Well it certainly
> > > > > > > > > > > not a binary tree it is a branching tree, so what is the name?
> > > > > > > > > >
> > > > > > > > > > When used for searching, any branching tree is simply called a search
> > > > > > > > > > tree. There are many much more specific terms depending on how the data
> > > > > > > > > > are organised in the tree. There are AVL trees, red-black trees, suffix
> > > > > > > > > > trees and so on. For words, I suspect the one you are looking for is
> > > > > > > > > > called a trie.
> > > > > > > > > >
> > > > > > > > > > I don't think there is a standard name for a tree where the number of
> > > > > > > > > > possible branches varies depending on where in the tree a node appears
> > > > > > > > > > (as one might use for chess games). It's just the tree of possible
> > > > > > > > > > moves.
> > > > > > > > > >
> > > > > > > > > > --
> > > > > > > > > > Ben.
> > > > > > > > >
> > > > > > > > > Are trie trees used in AI development Ben, it seem easy to weigh the outcome as you read in "trials"? Well i am going for an algorithm working on simple string with the advantage it can be saved down to file without any formatting "beside creation".
> > > > > > > > >
> > > > > > > > > What is the most efficient way in javascript, can you branch arrays? But then you have the hussle to format and store them and read them in? Here just the blob saved, i kind of like that but i guess performance wise it is hardly optimal to use a sting especially if it not indexed with levels?
> > > > > > > >
> > > > > > > > Well i may make a version using indexed levels instead once i finished the one with delimiters just to see how they compare.
> > > > > > >
> > > > > > > Just finished the algorithm to read thru string structure and i think i have all vital values to insert a new stringitem.
> > > > > > >
> > > > > > > Apparently there will be two special cases inserts before and after the string structure.
> > > > > >
> > > > > > This will just read out the words from the string structure.
> > > > > > But it will definitly make it easier to position to put in new words character by character into structure.
> > > > > >
> > > > > > [b[a[l[l*]][n[a[n[a*]]]][t*]][u[n*][t[t*]
> > > > > >
> > > > > > function searchReadThru() {
> > > > > > for (z = 0; z < encodedString.length; z++) {
> > > > > > if (encodedString.charAt(z) == "[") {
> > > > > > oldlevel=deeplevel;
> > > > > > deeplevel++;
> > > > > > alert("Level added"+deeplevel+" "+oldlevel+" "+stringNextMem);
> > > > > > } else if (encodedString.charAt(z) == "]") {
> > > > > > oldlevel=deeplevel;
> > > > > > deeplevel--;
> > > > > > stringNextMem = stringNextMem.slice(0, -1);
> > > > > > alert("Level revoked "+deeplevel+" "+oldlevel+" "+stringNextMem);
> > > > > > } else if (encodedString.charAt(z) == "*") {
> > > > > > alert("End word "+deeplevel+" "+oldlevel+" "+stringNextMem);
> > > > > > } else {
> > > > > > stringPrevMem = stringNextMem;
> > > > > > stringNextMem += encodedString.charAt(z);
> > > > > > alert("Newchar "+deeplevel+" "+oldlevel+" "+stringNextMem);
> > > > > > }
> > > > >
> > > > > Any new item i guess would be inserted here or?
> > > > > insertItem();
> > > >
> > > > Well any new check for in correct position to insert, so..
> > > >
> > > > if (encodedString.charAt(z) != "[" && encodedString.charAt(z) != "]" && encodedString.charAt(z) != "*") checkIfInsert();
> > > >
> > > > There is probably technics to search in alot faster for right spot then linear progression thru the string "if it is a big file"...
> > > >
> > > > But it is a start.
> > > >
> > > >
> > > > > -
> > > > > > }
> > > > > > }
> > >
> > > But for most games and board games like chess the number of openings is limited so if you read in board games linear progression will work good for inserts, i see there is about 12-15 in chess.
> >
> > A bit further i think i managed to position the and readout the input string so that it develop and follow the structure already in place and find the spot where the substring "character by character" readout structure get bigger then the readin substring, well the place todo the insert.
> >
> > Now it is just a matter of howto format the input string with brackets there could be a few cases.
>
> My ideas so good they are 30 years old.
>
> https://www.youtube.com/watch?v=Bm7zah_LrmE
If not 40 years old because i remember doing it in basic.
[toc] | [prev] | [next] | [standalone]
Page 1 of 2 [1] 2 Next page →
Back to top | Article view | comp.lang.javascript
csiph-web