Thread: Caracter input

  1. #31
    Registered User
    Join Date
    Nov 2008
    Posts
    49
    u know what.... i'm just going to revert back to the original code where the user would have to input a character at a time and submit my assignment... i'm sick of being picky, spent more time trying to fix little glitches that make my programs "nicer" than doing the actual work. and all for a couple xtra points.
    listen i appreciate the help but i just gotta focus on the exam now... this has taken me too long

    thanks a million.

  2. #32
    and the Hat of Guessing tabstop's Avatar
    Join Date
    Nov 2007
    Posts
    14,336
    Alright, there was a second place where code was used -- in the "you lose" message. That's why what prints when you lose doesn't seem to match. Sorry.

    Also, I was answering questions and forgot to mention that your white/black peg figure-outer is b0rked. Watch:
    Code:
    Votre coup (essai no 1): bjbv
    Couleurs identiques: 1
    Coleurs presentes: 1
    Votre coup (essai no 2): bbjv
    Couleurs identiques: 0
    Coleurs presentes: 4
    Votre coup (essai no 3): jbbv
    Couleurs identiques: 1
    Coleurs presentes: 1
    Votre coup (essai no 4): bvbj
    Couleurs identiques: 1
    Coleurs presentes: 1
    Votre coup (essai no 5): brbj
    Couleurs identiques: 1
    Coleurs presentes: 0
    Votre coup (essai no 6): vjrr
    Couleurs identiques: 1
    Coleurs presentes: 1
    Desole, la sequence de couleurs a deviner etait jjvj
    When I put the j in the wrong spot, I got credit for all three white pegs, even though I should really only have gotten credit for one. (You need a break after present++ to keep that for loop from finding every single other instance of the same color.) Edit: Oh, and if I had typed vjvj, I would have gotten 2 right + 1 present, instead of 3 right, since the first v would have erased the v in the code, and it wouldn't then match the actual v later.
    Last edited by tabstop; 12-14-2008 at 12:44 PM.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. continues input
    By Matty_Alan in forum C Programming
    Replies: 2
    Last Post: 06-22-2007, 10:04 PM
  2. Input statement problem
    By une in forum C Programming
    Replies: 3
    Last Post: 05-29-2007, 11:16 PM
  3. For loop problems, input please.
    By xIcyx in forum C Programming
    Replies: 2
    Last Post: 04-22-2007, 03:54 AM
  4. Simple Console Input for Beginners
    By jlou in forum C++ Programming
    Replies: 0
    Last Post: 06-21-2005, 01:50 PM
  5. Help with Input Checking
    By Derek in forum C Programming
    Replies: 7
    Last Post: 06-17-2003, 03:07 AM