#lang racket

(require "challenge.rkt")

(provide challenges)

;This file contains the challenges of the platform
;Make sure the id's are incremental, starting from 0 and correspond to the challenges displayed on the platform
;VERY IMPORTANT: NEVER ALLOW STATE! If state is allowed e.g. through set! it can be abused to simply hardcode the output
;I also recommend making the first challenge a sanity check for instance by having the input and output be the same

(define variable-names
  '(a b c d e f g h i j k l m n o p q r s t u v w x y z))

(define challenges
  (list
    (make-challenge
      0
      "This challenge is the sanity check! Try writing a lambda that adds one to its argument. If you're stuck on this one, ask one of the organisers for help"
      "IGCTF{YouPassedTheSanityCheck!}"
      (list 1 2 3 4 5 6 7 8 9 10)
      (list 2 3 4 5 6 7 8 9 10 11)
      `(,@(take variable-names 1) + lambda))
    (make-challenge
      1
      "Determine at which index the given string (first) contains the pattern 're' return -1 if the pattern is not found."
      "IGCTF{WeHaveRegexesForThis}"
      (list "red" "sure" "racket" "referendum" "literature" "" "counterexample" "differentiation" "バカ")
      (list 0 2 -1 0 8 -1 6 5 -1)
      `(,@(take variable-names 10) define lambda begin if and or + - = char=? string-ref string-length))
    (make-challenge
      2
      "Same as the previous one, but in a more convoluted way (or straightforward if you're into functional programming)."
      "IGCTF{WhyWriteALoopWhenYouCanJustWriteAContrivedFold}"
      (list "red" "sure" "racket" "referendum" "literature" "" "counterexample" "differentiation" "バカ")
      (list 0 2 -1 0 8 -1 6 5 -1)
      `(,@(take variable-names 10) define lambda begin if and or + - = char=? string->list map foldl cons car cdr append list quote))
    (make-challenge
      3
      "define and begin are bloat, you can do without them can't you?"
      "IGCTF{YouBetterHaveMadeAFixpointOperatorForThis}"
      (list "red" "sure" "racket" "referendum" "literature" "" "counterexample" "differentiation" "バカ")
      (list 0 2 -1 0 8 -1 6 5 -1)
      `(,@(take variable-names 10) lambda if and or + - = char=? string-ref string-length))))
