View Poll Results: What do you think about this idea

Voters
22. You may not vote on this poll
  • Yes, good idea

    20 90.91%
  • No, stupid idea

    1 4.55%
  • Who cares, who does coding problems for fun

    1 4.55%

Thread: Coding Problems

  1. #1
    Registered User
    Join Date
    Dec 2001
    Posts
    194

    Lightbulb Coding Problems

    So i got bored tonight, and saw that post about the number challange program, and wrote my own verson to fully solve the array for all the values.
    I currently don't have any coding projects, cus im still learning windows and direct x, so to keep my skills sharp I like to do problems like this.
    Is there anyway we could start a thread for this purpose, so if someone comes across a nice problem, on the web, or a homework project, they could share if with the rest of us. In order to prevent people from getting their homework done for them, no one would post code showing the answers.
    If we kept an archive of this, then it would also benifit newbies, so they would have a large sample of problems to do and learn from.

  2. #2
    Unregistered
    Guest
    Sounds like a good idea to me. I have the same problem because I am self taught.

  3. #3
    Registered User
    Join Date
    Jan 2002
    Posts
    7
    It sounds like a good idea. I doubt I would get any benifit from it because I simply don't have the time. I think there could be a better way to guard against homework. I would like to see the solutions that other people came up with. Maybe solutions should not posted for 30 days or something like that. Long after any project would be due in school.

    Just my $.02

  4. #4
    Registered User heat511's Avatar
    Join Date
    Dec 2001
    Posts
    169
    I think it's a good idea, but try and keep the problems complicated but short in code. That way everyone has time to at least make an attempt. (Even if it is pathetic)
    "uh uh uh, you didn't say the magic word"
    -Jurassic Park

  5. #5
    and the hat of int overfl Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    39,659
    Here's a bunch to work your way through
    http://acm.uva.es/problemset/

  6. #6
    ¡Amo fútbol!
    Join Date
    Dec 2001
    Posts
    2,138
    Thanx Salem, that should last me for a while.

  7. #7
    Registered User
    Join Date
    Jan 2002
    Posts
    11
    Hey Matty,

    I was working on that number challenge program. It'd be a great help if you could send the source code my way.

    [email protected]

    Thanks a bunch!

  8. #8
    Registered User
    Join Date
    Dec 2001
    Posts
    194
    I would love to, but my hard drive in my ThinkPad just died. I was having issues with is since the summer, and it can no longer be written to, so win2k wont let me log in.
    The algorithm to solve that number challenge problem is like so

    Code:
    Read In the text file to a 2d array
    Create 3d array with the format [row][col][possiblities]
    It will be bool IsPossible[16][16][16] each space in 2d matrix has 1-16 has possible values
    START
    Set all the possiblites to false
    for i=0 ; i<rows ; i++
       for j=0 ; j<cols ; j++
          if space is open ie==17 in the text file
            for p=1; p<= 16 ; p++
               if IsValid(i,j,p) see below for IsValid pseudocode
                     set IsPossible[i][j][p] to true
    
    for all spots that have only 1 possiblity set those to correct value
    go back to START unless board is filled
    
    bool IsValid(i,j,p)
    Current 4x4 square starts at ( 4 * (i/4) ),(4*(j/4)) 
    remember the fun integer math :) so that rounds to the next lowest multiple of 4
    if [i][j] is on the lead diagonal (ie [1][1] [2][2] [MAX][MAX] )
       Then it is only possible if the number p doesnt appear in the row i, col j, the lead diagonal, or the current 4x4 square.
    else if [i][j] is on the back diagonal (ie [0][MAX] [1][MAX-1] [2][MAX-2] )
       Then it is only possible if the number p doesnt appear in the row i, col j, the back diagonal, or the current 4x4 square.
    else
      p is only possible if p does not already appear in row i or   col j or the 4x4 square
    I made the 2d array that represented the board global, and wrote a bunch of functions to check if p was in a given row or col or diag or 4x4
    ex
    bool IsInRow(int r,int p);
    bool IsInCol(int c,int p);
    bool IsInLead(int r,int c,int p );
    bool IsInBack(int r,int c,int p);
    bool IsIn4x4(int r,int c, int p)

  9. #9
    Registered User
    Join Date
    Sep 2001
    Posts
    4,912
    Excellent idea, I say we take this to the moderators.

  10. #10
    left crog... back when? incognito's Avatar
    Join Date
    Oct 2001
    Posts
    1,427
    I think this is a good idea, because this can help both newbies and experienced programming.
    There are some real morons in this world please do not become one of them, do not become a victim of moronitis. PROGRAMMING IS THE FUTURE...THE FUTURE IS NOW!!!!!!!!!

    "...The only real game I thank in the world is baseball..." --Babe Ruth

    "Life is beautiful"-Don Corleone right before he died.

    "The expert on anything was once a beginner" -Baseball poster I own.


    Left cprog on 1-3-2005. Don't know when I am coming back. Thanks to those who helped me over the years.

  11. #11
    ¡Amo fútbol!
    Join Date
    Dec 2001
    Posts
    2,138
    Definately a good idea. Maybe we could have an entire forum dedicated to it and threads could be the problems and others responses. Salem, what do u think?

  12. #12
    Registered User
    Join Date
    Dec 2001
    Posts
    194
    Have you guys checked out that link salem posted?
    There are about 700 problems to solve, and your solution can be emailed and automaticly graded. It will tell you if you solved the problem, within the time and memory constraints.
    I think its better than any board that could be set up. There are many different solutions to a problem, and there would be alot of posts showing all the different ways to do so. Plus there is the whole issue of people being able to post homework/project questions just to get them done.
    If anyone else come across a site similar to the one salem posted, then feel free to share, but that site will keep me busy for a while.

  13. #13
    and the hat of int overfl Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    39,659
    Well said RpiMatty

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. No clue how to make a code to solve problems!
    By ctnzn in forum C Programming
    Replies: 8
    Last Post: 10-16-2008, 02:59 AM
  2. pointer coding
    By princez90 in forum C Programming
    Replies: 2
    Last Post: 05-15-2008, 10:07 AM
  3. Coding Guideline ....!!
    By imfeelingfortun in forum Tech Board
    Replies: 8
    Last Post: 10-08-2006, 07:09 AM
  4. Before Coding
    By cyberCLoWn in forum C++ Programming
    Replies: 16
    Last Post: 12-15-2003, 02:26 AM
  5. Coding Contest....
    By Koshare in forum A Brief History of Cprogramming.com
    Replies: 46
    Last Post: 10-14-2001, 04:32 PM