Sure, but that gets complicated when comparing two matching hands (flush vs flush, 2 pair vs 2pair). It’s more than a 50 line problem to solve.
I kind of want to take your 50 line challenge however :) I always loved playing poker, might be a fun exercise.