Skip to main content
replaced http://codegolf.stackexchange.com/ with https://codegolf.stackexchange.com/
Source Link

Racket Intermediate Student with Lambda, @Brian McCutchon@Brian McCutchon

(λ(n)(foldr(λ(p q)(cons((λ(x)(if(even? p)(range(+ x 1)(+ x n 1)1)(range(+ x n)x -1)))(* p n))q))'()(range 0 n 1))) 

(λ can be replaced by lambda, both are allowed in the regex.)

Since I can't get TIO to restrict to htdp-intermediate-lambda and I don't want to download a new language, I will just assume it is fine as long as I only use functions given on that page:
λ foldr cons if even? range + *.

Since TIO does not include the words "list" in the output (it just produces '((1 2 3 4) (8 7 6 5)…), if the above crack is rejected, consider this quick fix:

(λ(n)(cons 'list(foldr(λ(p q)(cons(cons 'list((λ(x)(if(even? p)(range(+ x 1)(+ x n 1)1)(range(+ x n)x -1)))(* p n)))q))'()(range 0 n 1)))) 

Racket Intermediate Student with Lambda, @Brian McCutchon

(λ(n)(foldr(λ(p q)(cons((λ(x)(if(even? p)(range(+ x 1)(+ x n 1)1)(range(+ x n)x -1)))(* p n))q))'()(range 0 n 1))) 

(λ can be replaced by lambda, both are allowed in the regex.)

Since I can't get TIO to restrict to htdp-intermediate-lambda and I don't want to download a new language, I will just assume it is fine as long as I only use functions given on that page:
λ foldr cons if even? range + *.

Since TIO does not include the words "list" in the output (it just produces '((1 2 3 4) (8 7 6 5)…), if the above crack is rejected, consider this quick fix:

(λ(n)(cons 'list(foldr(λ(p q)(cons(cons 'list((λ(x)(if(even? p)(range(+ x 1)(+ x n 1)1)(range(+ x n)x -1)))(* p n)))q))'()(range 0 n 1)))) 

Racket Intermediate Student with Lambda, @Brian McCutchon

(λ(n)(foldr(λ(p q)(cons((λ(x)(if(even? p)(range(+ x 1)(+ x n 1)1)(range(+ x n)x -1)))(* p n))q))'()(range 0 n 1))) 

(λ can be replaced by lambda, both are allowed in the regex.)

Since I can't get TIO to restrict to htdp-intermediate-lambda and I don't want to download a new language, I will just assume it is fine as long as I only use functions given on that page:
λ foldr cons if even? range + *.

Since TIO does not include the words "list" in the output (it just produces '((1 2 3 4) (8 7 6 5)…), if the above crack is rejected, consider this quick fix:

(λ(n)(cons 'list(foldr(λ(p q)(cons(cons 'list((λ(x)(if(even? p)(range(+ x 1)(+ x n 1)1)(range(+ x n)x -1)))(* p n)))q))'()(range 0 n 1)))) 
Source Link
kennytm
  • 7k
  • 20
  • 48

Racket Intermediate Student with Lambda, @Brian McCutchon

(λ(n)(foldr(λ(p q)(cons((λ(x)(if(even? p)(range(+ x 1)(+ x n 1)1)(range(+ x n)x -1)))(* p n))q))'()(range 0 n 1))) 

(λ can be replaced by lambda, both are allowed in the regex.)

Since I can't get TIO to restrict to htdp-intermediate-lambda and I don't want to download a new language, I will just assume it is fine as long as I only use functions given on that page:
λ foldr cons if even? range + *.

Since TIO does not include the words "list" in the output (it just produces '((1 2 3 4) (8 7 6 5)…), if the above crack is rejected, consider this quick fix:

(λ(n)(cons 'list(foldr(λ(p q)(cons(cons 'list((λ(x)(if(even? p)(range(+ x 1)(+ x n 1)1)(range(+ x n)x -1)))(* p n)))q))'()(range 0 n 1))))