PDA

View Full Version : Ugh, finally got the isValid function done



Reemer
03-09-2012, 06:39 PM
Would've been a lot easier to count the number of *'s and |'s if I didn't reset their count to 0 every time the loop ran.
Anyone else hate making stupid mistakes like that? It seems to happen to me a lot.

j03
03-10-2012, 12:23 AM
Haha yeah..............sort of...

Miguel
03-10-2012, 03:55 AM
[Only registered and activated users can see links]

Zachafer
03-11-2012, 12:16 PM
What were you trying to do? I think I know a real easy way to do it.

Reemer
03-11-2012, 12:20 PM
What were you trying to do? I think I know a real easy way to do it.

It was just for a Java assignment, it had to do with the Mayan number system, which was base 20. It only had four characters that were valid: "*", "|", "0", " ". The *'s were 1 and |'s were 5. |** would be 7 and * | would be 25 (because of the space). It had to be in a certain order (**| wouldn't work), and only 3 |'s were allowed and 4 *'s. No other characters were allowed either.

It wasn't so bad once I realized my silly mistake. Got the assignment done pretty easily after that.

Zachafer
03-11-2012, 12:32 PM
Next time check out regex!