I need an AI to be able to tell if there are 4 1s or 2s or anything of the same value adjacent to each other within a list. Simple but very hard unless I'm mistaken. e.g. 011110. So now the AI has to determine if there are four numbers of the same value adjacent to each other. In the example there is, since there are four 1s.
If it's too hard or impossible to be able to tell with anything of the same value, then I still want to know how to do it with just 1s.
I can do the rest I just need to now how to that one part. But it CANNOT be manually done. That would take me an eternity to do.
Offline
I'm working on it...give me a few minutes...
Offline
This should work...
set [counter1 v] to [1] set [current value v] to [n/a] set [# of occurances v] to [0] repeat (length of [list v] ) if <(item (counter1) of [list v] ) = (current value)> change [# of occurances v] by (1) if <(# of occurances) > [2]> say (join (current value) [ has occured 4 times.]) for (2) secs end else set [# of occurances v] to [0] set [current value v] to (item (counter1) of [list v] ) end change [counter1 v] by (1) end
Offline