Search:

Type: Posts; User: Newklear

Search: Search took 0.01 seconds.

  1. Replies
    14
    Views
    20,708

    Alright, its all working now, lots and lots of...

    Alright, its all working now, lots and lots of thanks to you, you've really been a great help :)

    And thanks for taking the time to actually explain what i was doing wrong... Hopefully i've never...
  2. Replies
    14
    Views
    20,708

    Ahh okay, didnt know that was the return value of...

    Ahh okay, didnt know that was the return value of fscanf.

    Alright, so the function showScoreboard works great now, but the sortScoreboard is still kind of messed up... I tried adding the same code...
  3. Replies
    14
    Views
    20,708

    I'm not able to test the code at the moment, but...

    I'm not able to test the code at the moment, but i was looking through it and am now wondering what that "num" variable is...

    You can store both the player.name and player.points in the same "int...
  4. Replies
    14
    Views
    20,708

    Okay, have had alot to do so havent been able to...

    Okay, have had alot to do so havent been able to program alot, but i tried it out again today, with no result... :(

    I tried following your 1-7 steps, but failed obviously.

    Heres the two...
  5. Replies
    14
    Views
    20,708

    Okay, so i've tried the fprintf and fscanf out a...

    Okay, so i've tried the fprintf and fscanf out a little and printing to the scoreboard textfile works, and reading from it works halfway... I can read the entries on the scoreboard, but it reads one...
  6. Replies
    14
    Views
    20,708

    Okay, so the function that adds entries to the...

    Okay, so the function that adds entries to the scoreboard looks like this:



    void addToScoreboard(int numberOfGuesses)
    {
    FILE *scoreboardFile = fopen("scoreboard.txt", "a");
    char...
  7. Replies
    14
    Views
    20,708

    Scoreboard saved in .txt file?

    Hello,

    I've been sort of making a tiny game to learn the basics in C programming where the computer generates an array of four unique, random numbers and then the player tries to guess those four...
  8. Replies
    28
    Views
    2,591

    Ahh, lots of thanks to both of you, it seems to...

    Ahh, lots of thanks to both of you, it seems to be working now.

    Gonna go over it a couple more times to see what it was i missed and try to learn from it now!
  9. Replies
    28
    Views
    2,591

    Ahh yes, sorry... But it should return R S S S ,...

    Ahh yes, sorry... But it should return R S S S , since the first 4 is correct and should give you an 'R', but the next three 4's are wrong, but still exist in the secretNumber array and should give...
  10. Replies
    28
    Views
    2,591

    I tried following that, and got this: ...

    I tried following that, and got this:


    for(i=0; i<ARR_SIZE; i++)
    {
    if( guess[i] == secretNumber[i] )
    {
    help[i] = 'R';

    }
  11. Replies
    28
    Views
    2,591

    Yes, i tried it... Did you? :P Mine was...

    Yes, i tried it... Did you? :P



    Mine was nicely indented though, wasn't it? :)
  12. Replies
    28
    Views
    2,591

    No, that doesnt work either.... I tried the...

    No, that doesnt work either....

    I tried the code you wrote and if the guess array and the secretNumber array were exactly the same, it produced S S S S, when it should produce R R R R, since all...
  13. Replies
    28
    Views
    2,591

    tried changing it to j

    tried changing it to j<=i, but its still not right...

    for example, if the secretNumber array is
    6, 3, 9, 2
    and the guess array is
    1, 2, 3, 4,
    it returns
    _ _ S _

    when it should return...
  14. Replies
    28
    Views
    2,591

    if by handling it you mean for example doing this...

    if by handling it you mean for example doing this instead:


    char help[ARR_SIZE] = {'_','_','_','_'};

    then no, it didnt help...
  15. Replies
    28
    Views
    2,591

    Yes, i've tried this, but its the number 2 in...

    Yes, i've tried this, but its the number 2 in your approach that i'm having problems with... :S
  16. Replies
    28
    Views
    2,591

    Alright, sorry if it was confusing, the problem...

    Alright, sorry if it was confusing, the problem is that it doesnt give the correct hints. For example, it sometimes gives an '_' when you should get an 'S'...

    I'll paste the whole code on...
  17. Replies
    28
    Views
    2,591

    Rookie looking for help!

    I couldn't think of a good title for the thread, hence the really bad one, sorry...

    I'm currently working on a "tiny" game to learn some of the basics in C. In short, the computer makes an array...
  18. Replies
    11
    Views
    14,038

    Ahh, found it... the [] in void fyllArray(Secret...

    Ahh, found it... the [] in void fyllArray(Secret hemligtTal[]) caused the error, fixed it now!
  19. Replies
    11
    Views
    14,038

    Ahh, thanks, stupid me didnt think of that :) ...

    Ahh, thanks, stupid me didnt think of that :)

    Now it works, and it might even be a simpler solution than the one the teacher showed us.




    #include <stdio.h>
    #include <time.h>
    #define...
  20. Replies
    11
    Views
    14,038

    its going from 0 to 10, so right now they...

    its going from 0 to 10, so right now they duplicate almost every time...
  21. Replies
    11
    Views
    14,038

    Generating 4 unique random numbers

    Hello,

    To begin with, i'm new to programming so try to keep it simple :)

    We're making a mastermind game at school, and i've done some of it already, but i need help with how to generate 4...
Results 1 to 21 of 22