Closed Thread
Page 1 of 2 12 LastLast
Results 1 to 10 of 19

Thread: 4 by 4 sudoku without using arrays

  1. #1
    mosyemessy is offline Newbie
    Join Date
    Jun 2009
    Posts
    4
    Rep Power
    0

    4 by 4 sudoku without using arrays

    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

  2. CODECALL Circuit advertisement
    Join Date
    Always
    Posts
    Many

     
  3. #2
    PythonPower's Avatar
    PythonPower is offline Programming Professional
    Join Date
    Feb 2009
    Posts
    228
    Rep Power
    13

    Re: 4 by 4 sudoku without using arrays

    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?

  4. #3
    Join Date
    Jul 2006
    Posts
    16,525
    Blog Entries
    75
    Rep Power
    144

    Re: 4 by 4 sudoku without using arrays

    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
    Programming is a branch of mathematics.
    My CodeCall Blog | My Personal Blog

  5. #4
    mosyemessy is offline Newbie
    Join Date
    Jun 2009
    Posts
    4
    Rep Power
    0

    Re: 4 by 4 sudoku without using arrays

    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

  6. #5
    Join Date
    Jul 2006
    Posts
    16,525
    Blog Entries
    75
    Rep Power
    144

    Re: 4 by 4 sudoku without using arrays

    You can use vectors instead of arrays, you could use map<pair<int,int>,int>, you could use...
    Programming is a branch of mathematics.
    My CodeCall Blog | My Personal Blog

  7. #6
    Join Date
    Apr 2009
    Location
    Trapped in my own little world.
    Posts
    2,487
    Rep Power
    33

    Re: 4 by 4 sudoku without using arrays

    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

  8. #7
    libbylibra is offline Newbie
    Join Date
    Jul 2009
    Posts
    8
    Rep Power
    0

    Re: 4 by 4 sudoku without using arrays

    It's a plain text game where all the grids will be design using "cout".
    No GUI included I guess.

    You can use vectors instead of arrays, you could use map<pair<int,int>,int>, you could use...
    Further explanation about using vector please.

  9. #8
    Join Date
    Jul 2006
    Posts
    16,525
    Blog Entries
    75
    Rep Power
    144

    Re: 4 by 4 sudoku without using arrays

    A vector is like a 1 D array, a vector of vectors is like a 2D array. Google "C++ vector".
    Programming is a branch of mathematics.
    My CodeCall Blog | My Personal Blog

  10. #9
    libbylibra is offline Newbie
    Join Date
    Jul 2009
    Posts
    8
    Rep Power
    0

    Re: 4 by 4 sudoku without using arrays

    I see...
    Btw, can't we use loop?

  11. #10
    Join Date
    Jul 2006
    Posts
    16,525
    Blog Entries
    75
    Rep Power
    144

    Re: 4 by 4 sudoku without using arrays

    Depending on the logic, perhaps.
    Programming is a branch of mathematics.
    My CodeCall Blog | My Personal Blog

Closed Thread
Page 1 of 2 12 LastLast

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Sudoku solver in python :D
    By Hot_Milo23 in forum Tutorials
    Replies: 7
    Last Post: 10-19-2009, 04:51 PM
  2. Sudoku on F acebook
    By Bierrie in forum Website Design
    Replies: 3
    Last Post: 09-02-2009, 09:36 AM
  3. homemade sudoku generator
    By mokszyk in forum C and C++
    Replies: 3
    Last Post: 06-20-2009, 03:37 AM
  4. sudoku solver !!help!!
    By vaibhav_cbeginner in forum C and C++
    Replies: 5
    Last Post: 07-22-2008, 03:45 PM
  5. Sudoku can be solved using SQL..Take a look!
    By roger in forum Database & Database Programming
    Replies: 5
    Last Post: 07-04-2006, 12:20 PM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts