@ Icetaller
Hi and welcome. Please read the problem with spoonfeeding.
Type: Posts; User: jps
@ Icetaller
Hi and welcome. Please read the problem with spoonfeeding.
Well with 8 maximum possible cases, even brute force is fast...
0 1 2
3 4 5
6 7 8
if ( winOn(0 1 2) ) { //top row wins }
if ( winOn(3 4 5) ) { //mid row wins }
if ( winOn(6 7 8) ) { //low...
Think of how many ways to win.
3 horizontal wins
3 vertical wins
2 diagonal wins
Does your method check each possibility?