omok | JS Omok | Canvas library
kandi X-RAY | omok Summary
kandi X-RAY | omok Summary
JS Omok
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
- Drawing the board
- Draw on click
- Add one or turn
- round position of mouse positions
- set mouse position on click
- Gets the position of a mouse event .
- Check if an angle is valid .
omok Key Features
omok Examples and Code Snippets
Community Discussions
Trending Discussions on omok
QUESTION
I am new to c++ and fstream (infile) and wanted to know how data is read from a txt file and how can I put that data in an array. Basically I am trying to make this korean game called omok. where the number of times a player gets their move 4 times simultaneously either vertically, horizontally or diagonally.
Input from the txt file
...ANSWER
Answered 2021-Sep-17 at 05:06In any software project one of the key aspect you have to think about are your data structures: what do you need to store, what is the best format to store it, etc. Very often the data structures will define a lot of the resulting performance and clarity of your software.
In your case you decided to use char**
, which I think is not a good choice. This basically reflects a piece of paper, but as a programmer your main task is abstraction
. You have to re-think problems in terms of best fit for math, numerical solutions, data flow, performance and efficiency. The bad news is: there is no general best solution, it fundamentally depends on the underlying problem to solve. Since I don't know this in your case, I just provide here a way to process the char**
data. And this is probably OK for you here, but in your next, larger, projects keep this in mind.
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install omok
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page