Please Disable Ad-Block To View This Website.

If you block ads, this site can not survive!

Ads are very minimal for registered users. If you don't have an account please register now!

DOWNLOAD
 Full Scripts
 Addons
 Snippets
 DLLs
 MTS Themes
 Tutorials
 Misc.
 File Queue
 Download mIRC
INTERACT
 Screenshots
 Challenge
 Top Downloads
 Submit Form
 Forums

SEARCH
Site Search

FRIENDS
Link to us!
PhotoShelf

Top Challenge Entrants

  # User Points
  1 jaytea 587
  2 [Znork] 303
  3 urza 297
  4 Ag2X 288
  5 dr_Eamer 255
  6 Albie 199
  7 Chessnut 197
  8 A Noniem 194
  9 zzattack 186
  10 Kol 185
  11 m910q 168
  12 Sephiroth 115
  13 Auron956 114
  14 patje 114
  15 chid 110
  16 Ohad2121 92
  17 SkorpSSS 87
  18 DixrouE 84
  19 Suchorski 83
  20 ^Vampire^ 74
Challenge:Smallest $reduce
Start:May 3rd 2010
End:May 7th 2010

Results

Another successfull challenge comes to a close again! Many found this one hard, although there was a dirty trick to the challenge.

The easiest way to complete this challenge was to simply take 3 characters from offset x, find the range of 1st and 3rd character, if its 1 or -1 then then replace the middle character with "-"

Doing it this way you will end up with multiple dashes, the dirty trick is simply to $remove these double dashes. This isn't the best method but its allowed for shorter sizes.

Now onto the results




There was a total of 16 non-regex of which 12 were valid and 3 regex entries of which 2 were valid


Congratulations to the winner jaytea! for both non-regex and regex entries. Also congrats to the runner up Znork (non regex) and Ag2X (regex).


Winner! jaytea (141 bytes!)
reduce {
  %i =
  :%c
  inc %i
  var %c $asc($mid($1,%i)),%s %s $+ $iif($calc((%c -%l)^-9999+3) & $v1,-,$chr(%l)),%l %c
  goto %c )
  :)
  return $deltok(%s,,45)
}



Winner! jaytea (99 bytes!)
reduce return $deltok($regsubex($1,/(.)/g,$iif($calc(($asc(\1)-$asc(\2))^-9999+3) & $v1,-,\1)),,45)


Non regex entries

Top entries:

1 jaytea 141 bytes
reduce {
  %i =
  :%c
  inc %i
  var %c $asc($mid($1,%i)),%s %s $+ $iif($calc((%c -%l)^-9999+3) & $v1,-,$chr(%l)),%l %c
  goto %c )
  :)
  return $deltok(%s,,45)
}
2 [Znork] 152 bytes
reduce {
  %s = $1.
  while (%s) var %a %b,%b %2 - $asc(%s),%r $replace(%r $+ $iif(%a = %b && %a isin -1,-,$chr(%2)),--,-),%2 $asc(%s),%s $mid(%s,2)
  return %r
}
3 Sephiroth 178 bytes
reduce {
  %i = $1
  while %i {
    var %u $asc(%i),%i $mid(%i,2),%s %u - $asc(%i),%f %y - %s,%y %s
    if %f || $abs(%s) != 1 {
      var %o $+(%o,$iif(%r > 1,-),$chr(%u)),%r
    }
    if (%s) inc %r
  }
  return %o
}
4 A Noniem 180 bytes
reduce {
  bset -tc &b 1 $1
  %a = 1
  while $bvar(&b,%a) {
    var %c $replace(%c,--,-) $+ $iif($calc(($bvar(&b,$({,%a))-$v1)*($v1 -$bvar(&b,$calc(1+%a)))) = 1,-,$mid($1,%a,1))
    inc %a
  }
  return %c
}
5 m910q 193 bytes
reduce {
  %l = 26
  while %l > 2 {
    %i = 1
    while $mid(abcdefghijklmnopqrstuvwxyzåzyxwvutsrqponmlkjihgfedcbaå,%i,%l) {
      tokenize 1 $replace($1,$v1,$+($left($v1,1),-,$right($v1,1)))
      inc %i
    }
    dec %l  
  }
  return $1
}
6 dr_Eamer 200 bytes
reduce {
  %r = $1
  %i = 97
  while %i < 123 { 
    z %i +
    z 220-%i -
    inc %i
  }
  v - + 
  return %r
}
z v $2 $b($1- 1) $b($1) $b($1- 2)
v %r = $replace(%r,$+($3,$2,$4),$+($3,$1,$4),$+($1,$2,$4),$1 $+ $4)
b return $chr($calc($1))
7 Ag2X 204 bytes
reduce {
  var %i 2,%s,%r,%d 1
  while $asc($mid($1,$({,%i))) {
    %t = $asc($mid($1,%i)) - $v1
    if %t = %s && $pos(1-1,%t) {
      if (%d) %r = %r $+ -
      %d =
    }
    else {
      %r = %r $+ $mid($1,$({,%i),1)
      %d = 1
      %s = %t
    }
    inc %i
  }
  return %r
}
8 Auron956 242 bytes
reduce {
  %s = $1
  tokenize 2 abcdefghijklmnopqrstuvwxyzzyxwvutsrqponmlkjihgfedcba
  a $*
  return %s
}
a {
  %l = 26
  while %l > 2 {
    %p = 1
    while %p < $calc(28-%l) {
      %s = $replace(%s,$mid($1,%p,%l),$+($mid($1,%p,1),-,$mid($1,$calc(%p -1+%l),1)))
      inc %p
    }
    dec %l
  }
}
9 Kol 253 bytes
reduce {
  var %r $1,%z abcdefghijklmnopqrstuvwxyz
  :o
  var %x 1,%y 26
  while %x < 25 {
    while ???* iswm $mid(%z,%x,%y) {
      %r = $replace(%r,$v2,$+($left($v2,1),-,$right($v2,1))) 
      dec %y
    }
    %y = 26 - %x
    inc %x
  }
  if a* iswm %z {
    %z = zyxwvutsrqponmlkjihgfedcba
    goto o
  }
  return %r
}
10 Lindrian 272 bytes
reduce {
  %d =
  %s =
  %i = 1
  while $mid($1,%i,1) {
    inc %i
    var %x $asc($v1),%y $asc($mid($1,%i,1)),%z %s - %x
    if $calc(1+%x) = %y || ($2 && $calc(1+%y) = %x && %y != %s) {
      if (!%s) %s = %x
    }
    else {
      %d = $+(%d,$chr(%s),$iif($abs(%z) > 1,-),$chr(%x))
      %s =
    }
  }
  if (!$2) r
  return %d
}
r reduce %d 1
11 Splin 662 bytes
reduce {
  %x = $len($1)
  %y = $null
  %z = %x
  while %x {
    %y = %y $asc($mid($1,%x,1))
    dec %x
  }
  %x = %z
  while %x {
    :1
    if ($gettok(%y,%x,32) == $calc($gettok(%y,$calc(%x - 1),32) + 1)) { 
      inc %k | dec %x | goto 1 
    }
    else {
      if %k > 1 {
        dec %k
        while %k {
          %t = $calc(%x + %k)
          %y = $instok($deltok(%y,%t,32),1,%t,32)
          dec %k
        }
      }
      %k = 0
      dec %x
    }
  }
  %x = %z
  while %x {
    :2
    if ($gettok(%y,%x,32) == $calc($gettok(%y,$calc(%x - 1),32) - 1)) { 
      inc %k | dec %x | goto 2
    }
    else {
      if %k > 1 {
        dec %k
        while %k {
          %t = $calc(%x + %k)
          %y = $instok($deltok(%y,%t,32),1,%t,32)
          dec %k
        }
      }
      %k = 0
      dec %x
    }
  }
  %x = $null
  while %z {
    %x = %x $+ $chr($gettok(%y,%z,32))
    dec %z
  }
  clipboard $replace(%x,$chr(1),$chr(32))
  return $replace($cb,$chr(32),-)
}


Invalid entries:

void- 188 bytes * Test failed: $reduce(eca) yours returned e-a / should of been eca
reduce {
  %i = 0
  while $mid($1,%i) {
    inc %i
    var %c %b,%b %a,%a $asc($mid($1,%i)),%d %a - %b,%e $calc((%a +%c)/2),%o $+(%o,$iif($abs(%d) && %e = %b,$iif($mid(%o,-1) != -,-),$chr(%b)))
  }
  return %o
}
dustin 243 bytes * Error allocating stack memory: doesnt work for entries >= $len(36)
f {
  %t = $mid($1,2)
  %d = $asc($1) - $asc(%t)
  if (!$2 || %d = $2) && %t && $abs(%d) = 1 %r $calc(1+$g(%t,%d))
}
g %r $f($1,$2)
h %r $reduce($1)
reduce {
  %r = return
  %i = $f($1) + 1
  if ($1) %r $+($left($1,1),$iif(%i > 2,-),$h($mid($1,$iif(%i > 2,%i,2))))
}
FroggieDaFrog 368 bytes * Test failed: $reduce(ace) yours returned a-e / should of been ace
alias reduce { var %r $left($1,1),%x 2
while (%x < $len($1-)) { var %p $asc($mid($1,$calc(%x -1),1)),%c $asc($mid($1,%x,1)),%n $asc($mid($1-,$calc(%x +1),1)),%r %r $+ $iif(%p = %c || $calc(%c - %p) != $calc(%n - %c),$chr(%c),$iif($right(%r,1) != -,-)) 
inc %x } 
return $+(%r,$iif($remove($calc($asc($right($1,1)) - $asc(Right(%r,1))),-) = 1,-),$iif($len($1) > 1,$right($1,1))) }
Jigsy 503 bytes * Test failed: $reduce(abd) yours returned ad / should of been abd
p return $iif($mid(%a,$calc($pos(%a,$1) $2 1),1),$v1,$1)
reduce {
  if $len($1) > 2 {
    %a = abcdefghijklmnopqrstuvwxyz
    %b = 0
    %e =
    %z =
    while %b < $len($1) {
      inc %b
      %c = $mid($1,%b,1)
      %d = $right(%z,1)
      if %c = %d {
        %z = %z $+ %c
      }
      else {
        :1
        if $p(%c,+) = %d || $p(%c,-) = %d {
          %d = %c
          inc %b
          if $mid($1,$calc(%b -2),1) = $mid($1,%b,1) {
            %z = %z $+ - $+ %c
          }
          %c = $mid($1,%b,1)
          inc %e
          goto 1
        }
        else {
          if %e > 1 {
            %z = %z $+ - $+ %d
            %e =
          }
          %z = %z $+ $iif(%e > 1,%d) $+ %c
        }
      }
    }
    if $right(%z,1) = - {
      %z = %z $+ $right($1,1)
    }
    return %z
  }
  return $1
crosbow 5848 bytes
reduce {
  /* the actual code is 44 Byte only, because the argument of the $replace command is STRING DATA not CODE!!!
  CODE: 
  var %o $replace($1,%x)
  return $replace(%o,%x)
  */
  var %o $replace($1,abc,a-c,a-cd,a-d,a-de,a-e,a-ef,a-f,a-fg,a-g,a-gh,a-h,a-hi,a-i,a-ij,a-j,a-jk,a-k,a-kl,a-l, $&
    a-lm,a-m,a-mn,a-n,a-no,a-o,a-op,a-p,a-pq,a-q,a-qr,a-r,a-rs,a-s,a-st,a-t,a-tu,a-u,a-uv,a-v,a-vw,a-w,a-wx,a-x,a-xy, $&
    a-y,a-yz,a-z,bcd,b-d,b-de,b-e,b-ef,b-f,b-fg,b-g,b-gh,b-h,b-hi,b-i,b-ij,b-j,b-jk,b-k,b-kl,b-l,b-lm,b-m,b-mn, $&
    b-n,b-no,b-o,b-op,b-p,b-pq,b-q,b-qr,b-r,b-rs,b-s,b-st,b-t,b-tu,b-u,b-uv,b-v,b-vw,b-w,b-wx,b-x,b-xy,b-y,b-yz,b-z,cde, $&
    c-e,c-ef,c-f,c-fg,c-g,c-gh,c-h,c-hi,c-i,c-ij,c-j,c-jk,c-k,c-kl,c-l,c-lm,c-m,c-mn,c-n,c-no,c-o,c-op,c-p,c-pq, $& 
    c-q,c-qr,c-r,c-rs,c-s,c-st,c-t,c-tu,c-u,c-uv,c-v,c-vw,c-w,c-wx,c-x,c-xy,c-y,c-yz,c-z,def,d-f,d-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,o-h,o-hg,o-g,o-gf,o-f,o-fe,o-e,o-ed,o-d,o-dc,o-c,o-cb,o-b,o-ba,o-a,nml,n-l, $&
    n-lk,n-k,n-kj,n-j,n-ji,n-i,n-ih,n-h,n-hg,n-g,n-gf,n-f,n-fe,n-e,n-ed,n-d,n-dc,n-c,n-cb,n-b,n-ba,n-a, $&
    mlk,m-k,m-kj,m-j,m-ji,m-i,m-ih,m-h,m-hg,m-g,m-gf,m-f,m-fe,m-e,m-ed,m-d,m-dc,m-c,m-cb,m-b, $&
    m-ba,m-a,lkj,l-j,l-ml,l-l,l-lk,l-k,l-kj,l-j,l-ji,l-i,l-ih,l-h,l-hg,l-g,l-gf,l-f,l-fe,l-e,l-ed,l-d,l-dc,l-c,l-cb,l-b, $&
    l-ba,l-a,kji,k-i,k-lk,k-k,k-kj,k-j,k-ji,k-i,k-ih,k-h,k-hg,k-g,k-gf,k-f,k-fe,k-e,k-ed,k-d,k-dc,k-c,k-cb,k-b,k-ba,k-a, $&
    jih,j-h,j-hg,j-g,j-gf,j-f,j-fe,j-e,j-ed,j-d,j-dc,j-c,j-cb,j-b,j-ba,j-a,ihg,i-g,i-ji,i-i, $&
    i-ih,i-h,i-hg,i-g,i-gf,i-f,i-fe,i-e,i-ed,i-d,i-dc,i-c,i-cb,i-b,i-ba,i-a,hgf,h-f,h-fe,h-e, $&
    h-ed,h-d,h-dc,h-c,h-cb,h-b,h-ba,h-a,gfe,g-e,g-ed,g-d,g-dc,g-c,g-cb,g-b,g-ba,g-a,fed,f-d, $&
    f-dc,f-c,f-cb,f-b,f-ba,f-a,edc,e-c,e-fe,e-e,e-ed,e-d,e-dc,e-c,e-cb,e-b,e-ba,e-a,dcb,d-b, $&
    d-ba,d-a,cba,c-a)
}



Regex entries

Top entries:

1 jaytea 99 bytes
reduce return $deltok($regsubex($1,/(.)/g,$iif($calc(($asc(\1)-$asc(\2))^-9999+3) & $v1,-,\1)),,45)
2 Ag2X 168 bytes
reduce return $left($regsubex($1_,/(.)(?=.)/g,$°(\1,\2,%d)),-1)
° {
  if $calc($asc($1)-$asc($2)) = %s && $v1 isin 1-1 {
    %d =
    if ($3) return -
  }
  else {
    %d = 1
    %s = $v1
    return $1
  }
}


Invalid entries:

Tom- 359 bytes * Test failed: $reduce(ab) yours returned a-b / should of been ab
/Reduce {
  if ($2) {
    var %a abcdefghijklmnopqrstuvwxyz
    $iif($pos(%a,$2,1) == $calc($pos(%a,$1,1) +1),return -)
    $iif($pos(%a,$2,1) == $calc($pos(%a,$1,1) -1),return ")
  }
  else {
    return $remove($regsubex($regsubex($regsubex($left($1,1) $+ $regsubex($1,/(.)/g,$iif($reduce(\1,$iif(\2,$v1,2)),$v1,:) \2),/(-.[^:"]+-)/g,-),/([a-z]-)/g,: \1),/(".[^:]+")/g,-),$chr(32),:,")
  }
}