i know I know our hands are pretty empty when we can't use arrays.
4 by 4 sudoku without arrays. you know sudoku don't ya?
hei I'm a IT student and I have this assignment.
I'M NOT A CODE STEALLER. I DO WANT TO LEARN. I'm just not really sure about the logic of it all. i know because we can't use arrays so the whole usage of for loops. or any loops for that matter, is gone. so do we have to just start writting this humungous amount of IFs??
last but not least comes the the input retreival. do we get all the numbers in the beginning and start checking them, or can we go through them one by one? in order to make the code reading more pleasant. pleas do help me out with your ideas.
i am also looking for a free software for drawing flowcharts. if any body has anything let me know.
thank you all
Firstly, what is the assignment? "4×4 soduko" is not specific enough. By the sounds of things you just have to validate that a given board is valid; is this right?
Is this in C or C++? Vectors come to mind for C++.
For flowcharting:
Dia draws your structured diagrams: Free Windows version of the popular open source program <-- easier to use at first
Dynamic Draw <-- more powerful
thanks for replying people. i'm sorry i tried to upload the pdf file for the specification but the forum said something like i didn't have enough points or something.
this sudoku has 4 columns and 4 rows. and has four rules.
1. numbers should be from 1 to 4.
2. each row must only have once own any numbers from 1 to 4 ( eg. 1 2 2 3 is wrong, 4 3 2 1 i s right)
3. number 2 rule about columns.
4. number 3 rule about each sub squares. it has 4 squares of 4 houses.( column one first and secon row, column two first and second row for example.)
and lastly it is written in c++. how can it be any better for me in this program?? thanks again
You can use vectors instead of arrays, you could use map<pair<int,int>,int>, you could use...
Is this a plain text game or does it needa be GUI?
If you cannot do loops that means you might have to reuse code IMO. I could be wrong tho I have never tried doing things without it.
If they input all the moves at once you might not need a loop.. only check once they are done? Then just accept input and validate that every row and column only contains 1-4.
You could use nodes or something for this - array like things =) not sure if you have covered those or not but they are like arrays but you dont call them that so they are safe lol
It's a plain text game where all the grids will be design using "cout".
No GUI included I guess.
Further explanation about using vector please.You can use vectors instead of arrays, you could use map<pair<int,int>,int>, you could use...
A vector is like a 1 D array, a vector of vectors is like a 2D array. Google "C++ vector".
I see...
Btw, can't we use loop?
Depending on the logic, perhaps.
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks