3 ms·
naive q: could one just count one of the letters and subtract it from the total number of letters?
by throwaway14356 3y ago
naive q: could one just count one of the letters and subtract it from the total number of letters?
- saagarjha 3y agoYou’d need to count both as other characters are ignored.
- throwaway14356 3y agonaïve q2: does that mean most comparisons are no match 3 times? could one do a bitwise operation and fuzzy test for all 3 in one go?
- 6510 3y agoIs it still ASCII? If so p is 01110000 and s is 01110011(?) but I don't know what \0 is, is it 00000000? Is there anything else know about the data? If the rest of the characters are all numbers, those all start with 0011 but that doesn't seem of much use. 4-9 have either the 5th or 6th bit set. Only if AND with 00001100 yields zero the other 3 tests are needed. Ofc I have no idea what opcodes the language provides.
- throwaway14356 3y agoHere is a perfectly useless idea: AND with 00000010 would give 2 for s an 0 for p. (-1 and you have +1 for s and -1 for p as the article describes) Then you have a number that one could just add in stead of jumping to +1 or -1.