Bulls and cows: Difference between revisions

m
m (→‎{{header|Sidef}}: updated code)
Line 4,603:
var cows = 0
 
var input = Sys.scanln("Input: ").chars \
read("Input: ", String).unique chars \
.uniq .grep {.~~/^[1-9]$/} \
.mapgrep(/^[1-9]$/) {.to_i}\
.map{.to_n}
 
if (input.len != size) {
Line 4,619 ⟶ 4,620:
}
 
for i (^num.range.each) { |i|
if (num[i] == input[i]) {
bulls++
2,747

edits