Advertisement
Guest User

Untitled

a guest
Jan 8th, 2019
163
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Haxe 0.77 KB | None | 0 0
  1.  private static function findSequence(list:Array<SymbolInfoItem>, sequence:CsList<Int>):CsList<Int> {
  2.         var sequinceIds = sequence.toArray().join("");
  3.         for (i in 0...list.length) {
  4.             var listIds = list.map(function(element:SymbolInfoItem):Int {
  5.                 return element.value.id;
  6.             }).join("");
  7.             if (listIds.indexOf(sequinceIds) == 0) {
  8.                 var ids = list.map(function(element:SymbolInfoItem):Int {
  9.                     return element.id;
  10.                 }).slice(0, sequence.length());
  11.  
  12.                 return CsList.fromIterable(ids);
  13.             }
  14.  
  15.             var first = list[0];
  16.             list = list.slice(1);
  17.             list.push(first);
  18.         }
  19.         return new CsList(sequence.length());
  20.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement