+ Reply to Thread
Page 1 of 2
1 2 LastLast
Results 1 to 10 of 19

Thread: 4 by 4 sudoku without using arrays

  1. #1
    Newbie mosyemessy is an unknown quantity at this point
    Join Date
    Jul 2009
    Posts
    4

    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. #2
    Programming Professional PythonPower is on a distinguished road PythonPower's Avatar
    Join Date
    Feb 2009
    Location
    England
    Posts
    228

    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?
    Old: 19543634061503069431898480521767684453431945494947 93961697675137336753 = 432363203127002885506543172618401 × 4520189026299330782353421687996961553
    New: How many ways can one partition 369?

  3. #3
    Super Moderator WingedPanther has much to be proud of WingedPanther has much to be proud of WingedPanther has much to be proud of WingedPanther has much to be proud of WingedPanther has much to be proud of WingedPanther has much to be proud of WingedPanther has much to be proud of WingedPanther has much to be proud of WingedPanther has much to be proud of WingedPanther's Avatar
    Join Date
    Jul 2006
    Age
    36
    Posts
    11,697
    Blog Entries
    57

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

  4. #4
    Newbie mosyemessy is an unknown quantity at this point
    Join Date
    Jul 2009
    Posts
    4

    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

  5. #5
    Super Moderator WingedPanther has much to be proud of WingedPanther has much to be proud of WingedPanther has much to be proud of WingedPanther has much to be proud of WingedPanther has much to be proud of WingedPanther has much to be proud of WingedPanther has much to be proud of WingedPanther has much to be proud of WingedPanther has much to be proud of WingedPanther's Avatar
    Join Date
    Jul 2006
    Age
    36
    Posts
    11,697
    Blog Entries
    57

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

  6. #6
    Code Warrior BlaineSch is a glorious beacon of light BlaineSch is a glorious beacon of light BlaineSch is a glorious beacon of light BlaineSch is a glorious beacon of light BlaineSch is a glorious beacon of light BlaineSch is a glorious beacon of light BlaineSch's Avatar
    Join Date
    Apr 2009
    Location
    Trapped in my own little world.
    Age
    20
    Posts
    2,223
    Blog Entries
    8

    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

  7. #7
    Newbie libbylibra is an unknown quantity at this point
    Join Date
    Jul 2009
    Posts
    8

    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.

  8. #8
    Super Moderator WingedPanther has much to be proud of WingedPanther has much to be proud of WingedPanther has much to be proud of WingedPanther has much to be proud of WingedPanther has much to be proud of WingedPanther has much to be proud of WingedPanther has much to be proud of WingedPanther has much to be proud of WingedPanther has much to be proud of WingedPanther's Avatar
    Join Date
    Jul 2006
    Age
    36
    Posts
    11,697
    Blog Entries
    57

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

  9. #9
    Newbie libbylibra is an unknown quantity at this point
    Join Date
    Jul 2009
    Posts
    8

    Re: 4 by 4 sudoku without using arrays

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

  10. #10
    Super Moderator WingedPanther has much to be proud of WingedPanther has much to be proud of WingedPanther has much to be proud of WingedPanther has much to be proud of WingedPanther has much to be proud of WingedPanther has much to be proud of WingedPanther has much to be proud of WingedPanther has much to be proud of WingedPanther has much to be proud of WingedPanther's Avatar
    Join Date
    Jul 2006
    Age
    36
    Posts
    11,697
    Blog Entries
    57

    Re: 4 by 4 sudoku without using arrays

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

+ Reply to Thread
Page 1 of 2
1 2 LastLast

Thread Information

Users Browsing this Thread

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

     

Similar Threads

  1. Multi-dimensional arrays
    By WingedPanther in forum C Tutorials
    Replies: 5
    Last Post: 11-15-2009, 08:40 PM
  2. Multidimensional Arrays
    By chili5 in forum Java Tutorials
    Replies: 22
    Last Post: 08-14-2009, 11:02 AM
  3. Char arrays in C
    By outsid3r in forum C Tutorials
    Replies: 4
    Last Post: 07-28-2009, 03:38 PM
  4. PHP Arrays
    By chili5 in forum PHP Tutorials
    Replies: 7
    Last Post: 05-22-2009, 04:16 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, 02:20 PM

Bookmarks

Bookmarks

     
        Algorithms and Data Structures

        Java tutorials

        Algorithms Forum

Posting Permissions

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