My example replaces your entire while() loop. It's also just a bare skeleton, like I said; there's bits you need to fill in yourself. I'll comment it better to give you more idea what it's doing and what's not finished. I've also fixed some problems I just noticed in my first version.
Thanks for the reply i don't think i have done it right but i have put the code in there and deleted some like this
I get this error
board.cpp: In function ‘int main()':
board.cpp:66: error: ‘gameover' was not declared in this scope
board.cpp: At global scope:
board.cpp:95: error: expected constructor, destructor, or type conversion before ‘<<' token
board.cpp:97: error: expected declaration before ‘}' token
Is there bits i need to change because i don't really understand it