I'm trying to make the program go through a predetermined string and read each character 1 by 1 in a manner similar to what I have posted. The IDE tells me that I cannot do "cs >= 1" because ">=" is not part of "(Char => Boolean) => Int".
def move(s: String) {
var chemov = s.take(1)
var cs = s.count(_)
while (cs >= 1){
ad()
s.drop(1)
}
}
sdoes not modify bys.drop(1). That function returns the string without the first character. Alsocs, never updates, so even ifcswas an integer, the loop would never terminate.chemov? It contains the first character ofs, but since it is never used, ands.take(1)does not modifys, the operation has no effect.