Skip to content

Commit

Permalink
Omit return keyword in single line functions
Browse files Browse the repository at this point in the history
  • Loading branch information
keiravillekode committed Nov 8, 2023
1 parent 53924e0 commit c49b01a
Showing 1 changed file with 3 additions and 12 deletions.
15 changes: 3 additions & 12 deletions exercises/practice/crypto-square/.meta/proof.ci.wren
Original file line number Diff line number Diff line change
Expand Up @@ -17,20 +17,11 @@ class CryptoSquare {
}

static ciphertext(plaintext) {
var toLower = Fn.new {|codePoint|
if ((65..90).contains(codePoint)) {
codePoint = codePoint + 32
}
return codePoint
}
var toLower = Fn.new {|codePoint| ((65..90).contains(codePoint)) ? codePoint + 32 : codePoint }

var isAlphanumeric = Fn.new {|codePoint|
return (48..57).contains(codePoint) || (65..90).contains(codePoint) || (97..122).contains(codePoint)
}
var isAlphanumeric = Fn.new {|codePoint| (48..57).contains(codePoint) || (65..90).contains(codePoint) || (97..122).contains(codePoint) }

var toString = Fn.new {|codePoint|
return String.fromCodePoint(codePoint)
}
var toString = Fn.new {|codePoint| String.fromCodePoint(codePoint) }

var codePoints = plaintext.codePoints.map(toLower).where(isAlphanumeric).toList

Expand Down

0 comments on commit c49b01a

Please sign in to comment.