No, you didnt. You just used a grenade AS a number. You did the exact same thing as everyone else who solves the problem, you just used an abstraction of a number.
What you’re saying is “I got four each of apples, bananas, oranges, strawberries, and kiwis, and solved the problem without numbers by putting them in sequences.”
apple = 1
banana = 2
orange = 3
strawberry = 4
kiwi = 0
It’s not doing it without maths, it’s just using a different language. Instead of the number, you have a thing.
Also for those that may actually be interested, since this back and forth stirred my coding brain and the ugliness of my previous code, I flexed it a bit and wrote a function that does it for any number of wheels up to 35:
function combowheel(w) {
let alphabet = "0123456789abcdefghijklmnopqrstuvwxyz";
let array = LoopIt(w,"",alphabet.substring(0,w+1).split(""));
array.splice(0,1);
let cypher = ";!@#$%^&*:ABCDEFGHIJKLMNOPQRSTUVWXYZ";
return array.filter((x) => x.split("").map((y,i) => (y == "0") ? cypher[i] : y).filter((v,i,a) => a.indexOf(v) === i).length === x.length);
}
function LoopIt(depth, baseString, arrLetters) {
var returnValue = "";
for (var i = 0; i < arrLetters.length; i++) {
returnValue += (depth == 1 ? "," + baseString + arrLetters[i] : LoopIt(depth - 1, baseString + arrLetters[i], arrLetters));
}
return returnValue.split(",");
}
With thanks to @DaveMaxwell’s code for generating combinations here
[Fair warning: I am not responsible for you flooding your memory buffer by attempting to store 35^36 strings in an array.]