For a homework assignment, I need to convert a string of numbers into an array of booleans. The string is a bunch of random numbers (0-9) in sequence, with no spaces. It looks something like this: 0123452348949230740329817438120947392147809231419. I need to make it so that each even number represents a "True" boolean and so that each odd number represents a "False" boolean. I think that I first need to convert each element of the string into a number, and then use a case structure (or something) to say, for each element of the array, "If even, then true. If odd, then false," but I could be wrong. Any suggestions?
↧