All pastes #1901831 Raw Edit

Someone

public text v1 · immutable
#1901831 ·published 2010-07-16 15:40 UTC
rendered paste body
alias notes_test {
  ; This alias was made using SwiftIRC's example, which can be found at http://forum.swiftirc.net/viewtopic.php?p=221868#p221868
;MODIFIED BY KOL YO
  ; If the identifier would be $id(parameters), fill in "id" here
  var %identifier_name = notes

  ; Parameters. Syntax: [PARAMETER1[,PARAMETER2[,PARAMETER3 ... ]]][.PROP]=RESULT[_RESULT2[_RESULT3 ... ]]|[PARAMETER1 ...
  ; Example: var %tests = param1,param2.prop=result1|param1=$false_result2
  ; This would be $id(param1,param2).prop must be result1, and $id(param1) must be $false OR result2
  var %tests = C,1 2 3 4 5 6 7 8 9 10 11 12=C D E F G A B C D E F G|C#,1 2 3 4 5 6 7 8 9 10 11 12=C# D# F F# G# A# C C# D# F F# G#| $+ $&
    Db,1 2 3 4 5 6 7 8 9 10 11 12=Db Eb F Gb Ab Bb C Db Eb F Gb Ab|D,1 2 3 4 5 6 7 8 9 10 11 12=D E F# G A B C# D E F# G A| $+ $&
    D#,1 2 3 4 5 6 7 8 9 10 11 12=D# F G G# A# C D D# F G G# A#|Eb,1 2 3 4 5 6 7 8 9 10 11 12=Eb F G Ab Bb C D Eb F G Ab Bb| $+ $&
    E,1 2 3 4 5 6 7 8 9 10 11 12=E F# G# A B C# D# E F# G# A B|F,1 2 3 4 5 6 7 8 9 10 11 12=F G A A# C D E F G A A# C| $+ $&
    F#,1 2 3 4 5 6 7 8 9 10 11 12=F# G# A# B C# D# F F# G# A# B C#|Gb,1 2 3 4 5 6 7 8 9 10 11 12=Gb Ab Bb B Db Eb F Gb Ab Bb B Db| $+ $&
    G,1 2 3 4 5 6 7 8 9 10 11 12=G A B C D E F# G A B C D|G#,1 2 3 4 5 6 7 8 9 10 11 12=G# A# C C# D# F G G# A# C C# D#| $+ $&
    Ab,1 2 3 4 5 6 7 8 9 10 11 12=Ab Bb C Db Eb F G Ab Bb C Db Eb|A,1 2 3 4 5 6 7 8 9 10 11 12=A B C# D E F# G# A B C# D E| $+ $&
    A#,1 2 3 4 5 6 7 8 9 10 11 12=A# C D D# F G A A# C D D# F|Bb,1 2 3 4 5 6 7 8 9 10 11 12=Bb C D Eb F G A Bb C D Eb F| $+ $&
    B,1 2 3 4 5 6 7 8 9 10 11 12=B C# D# E F# G# A# B C# D# E F#|Eb,1375913 207648 1939 68383=D D D D|C,7 6 2 4 6 1 3 4 6 5=B A D F A C E F A G

  ; DO NOT EDIT BELOW
  var %c = 1, %good = 0, %false = 0
  while (%c <= $numtok(%tests, 124)) {
    var %result = 1, %thisfalse = $true, %identifier = $ $+ %identifier_name $+ $chr(40) $+ $gettok($gettok($gettok(%tests, %c, 124), 1, 61), 1--2, 46) $+ $chr(41) $+ $iif($numtok($gettok($gettok(%tests, %c, 124), 1, 61), 46) > 1, . $+ $gettok($gettok($gettok(%tests, %c, 124), 1, 61), -1, 46)), %results
    while (%result <= $numtok($gettok($gettok(%tests, %c, 124), 2, 61), 95)) {
      %results = %results or $gettok($gettok($gettok(%tests, %c, 124), 2, 61), %result, 95)
      if ($eval(%identifier,2) === $gettok($gettok($gettok(%tests, %c, 124), 2, 61), %result, 95)) {
        var %thisfalse = $false     
      }
      else {
        var %thisresult = $v1
      }
      inc %result
    }
    if (%thisfalse == $false) {   
      inc %good
    }
    else {
      echo 4 -a Error: %identifier should return $+(03,$right(%results, -3),) - yours returned $+(07,%thisresult,.)
      inc %false
    }
    inc %c
  }
  echo $iif(%false > 0, 4, 3) -a Test is done: you succeeded on %good $+ / $+ $calc(%false + %good) tests - this is $calc(%good / (%good + %false) * 100) $+ % $+ .
}