Move generation, captures only generation, make move and unmake move all benefit greatly from jump tables. There are 12 cases just for the pawn. We can get to the correct pawn code by one jump that is not conditional or we can get there by IF IF IF IF IF IF IF IF IF IF IF IF until we find the correct one. The problem in chess is it is constantly in flux and predicting the outcome of any if statement tends toward 50/50 and false branch predictions drags down performance tremendously. If ones goal was to write a correct but intolerably slow chess engine then it does not matter. But in this tutorial my code does not make sense because it is counter productive to the goal of writing a fast chess engine. If statements are just not good for performance in a chess engine.
You could get there with 12 IF statements, if you were a complete beginner at data interpretation. Simply by breaking those statements into binary values, you easily reduce the maximum number of comparisons down to 4.
IF X < 7 THEN '1 TO 6
IF X < 4 THEN '1 TO 3
IF X < 3 THEN 'IT'S 1 OR 2
IF X < 2 THEN 'IT'S 1 ELSE 'IT'S 2
ELSE 'IT'S 3
END IF
ELSE 'IT'S 4 TO 6
'AS ABOVE
END IF
ELSE 'IT'S 7 TO 12
'AS ABOVE
END IF
A maximum of 4 comparisons for up to 16 items... It's not quite as fast as 1 to 1 jump tables, but it's not bad overall.
Remember, you can always fall back on the old ON... GOTO... statements also.
ON X GOTO 100, 200, 300, 400, 500, 600, 700, 800, 900, 1000, 1100, 1200
I think those tend to be 1 to 1 jump style lists.