Search:

Type: Posts; User: Michael432000

Page 1 of 2 1 2

Search: Search took 0.01 seconds.

  1. Replies
    6
    Views
    1,954

    You need to improve your keyboard input routines....

    You need to improve your keyboard input routines. I’ve tidied it up slightly but if you enter a character then your program will crash.

    If you reference your grade array with an index > 24 then...
  2. Thank you nick. But you don’t owe me anything,...

    Thank you nick. But you don’t owe me anything, its been a pleasure to share the little bit of c++ knowledge I’ve learnt. And lots of very nice people on this forum have helped me too, so we all move...
  3. Replies
    13
    Views
    1,388

    Syntax for your if statements is wrong. if...

    Syntax for your if statements is wrong.



    if ((score >= 90) && (score <= 100)) A_count++;
    score++;
  4. Replies
    13
    Views
    1,388

    Well, the data you presented is a bit confusing...

    Well, the data you presented is a bit confusing because it suggested input from a file, 2 scores: 80, 97; 5 scores: 69, 79, 89, 99, 58; etc

    And also you have stated above: ‘No input will be...
  5. This should get something printing out for you,...

    This should get something printing out for you, which will hopefully make it more clear.



    int main()
    {

    ////////////int row[100] = {0};
    ////////////int column[100] = {0};...
  6. Don’t worry; when you get it working and the...

    Don’t worry; when you get it working and the results are printed out it will make more sense to you.

    Don’t forget, you are only printing out the results for successful attempts, so if the mole...
  7. Replies
    13
    Views
    1,388

    Here’s something to get you started if you’re...

    Here’s something to get you started if you’re still stuck.

    But you need to find out where your data is and how you are going to access it.

    Note: I have a propensity for using for loops, but...
  8. Yes. But, the break statement simply breaks...

    Yes.

    But, the break statement simply breaks out of the current loop.

    In the above code the next statement to be executed would be the main for loop with i incremented by 1, and off we go again.
  9. You’re doing fine, keep going, I’m not very good...

    You’re doing fine, keep going, I’m not very good at explaining things, lol.

    Ok, so it’s an 8*8 grid and if the mole is at position (3,8) and the next move is to the right, then he reaches the...
  10. Call to srand() goes at start of program before...

    Call to srand() goes at start of program before the loops.

    Make sure you understand what the rand statement is doing.

    I noticed you coded rand() % 5.

    When rand() returns a value of 10,...
  11. First thing, decide whether your grid is 8X8 or...

    First thing, decide whether your grid is 8X8 or 9X9, you keep changing.

    Now on a piece of paper, draw a grid like a chessboard, 8x8.

    Now number the squares along the top from 1 to 8 going from...
  12. Thread: help pls

    by Michael432000
    Replies
    5
    Views
    1,150

    Q2. name has 36 characters, 0-35 when rand()...

    Q2.
    name has 36 characters, 0-35
    when rand() returns 36, or 73, or 110 etc etc
    36 mod 37 = 36 = space
    73 mod 37 = 36 = space

    so use mod 36

    *
  13. Start position: row[0] = 3, col[0] = 2 index 0 of...

    Start position: row[0] = 3, col[0] = 2 index 0 of row array contains value 3
    Move right: row[1] = 3, col[1] = 3
    Move right: row[2] = 3, col[2] = 4
    move down: row[3] = 4, col[3] = 4 ...
  14. Why not start off with a simplified version,...

    Why not start off with a simplified version, whereby the number of moves per game is restricted to say 100, else failed attempt. Then you can easily get started with one-dimensional arrays.
    ...
  15. I’m happy to show you how to do this if it’s not...

    I’m happy to show you how to do this if it’s not too late.
  16. Replies
    7
    Views
    1,327

    Yes, with two, if you’re happy to use a simple if...

    Yes, with two, if you’re happy to use a simple if else statement.
  17. Replies
    7
    Views
    1,327

    Goodness me, that’s way too complicated, lol. ...

    Goodness me, that’s way too complicated, lol.

    It can be done with 3 integers.
  18. Replies
    5
    Views
    6,458

    Walkthrough: Compiling a Native C++ Program on...

    Walkthrough: Compiling a Native C++ Program on the Command Line (C++)

    But using the Visual Studio IDE (Integrated Development Environment) is much better. Just create an empty project and add a...
  19. You could use just one array and hold the card...

    You could use just one array and hold the card number, 1 of 52 possibilities, as an integer.

    Let’s say there are 100 hands of 5 cards.

    Int My_hand[100][5];

    8 of Clubs
    King of Diamonds
    3...
  20. Replies
    19
    Views
    7,738

    Thank you for the explanation. It all works fine...

    Thank you for the explanation. It all works fine now.

    Of course I don’t wish to use this code. I just want to understand it so I can write my own, tailored to my own needs.

    Thanks for sharing.
  21. Replies
    19
    Views
    7,738

    Hi Whiteflags! Lol, I’m working with Elysia’s...

    Hi Whiteflags! Lol, I’m working with Elysia’s code, which I got compiled at last.

    The code I posted (#3) was just to show a fellow beginner programmer that there are alternatives you can mess...
  22. Replies
    19
    Views
    7,738

    That code is too advanced for me too, at the...

    That code is too advanced for me too, at the moment, but I will keep working on it, or towards it.

    If that boost library is a dead dependency, then what about the reference to boost on line 16?
    ...
  23. Thread: Help

    by Michael432000
    Replies
    2
    Views
    1,048

    You can mess around with strings and things. I...

    You can mess around with strings and things.

    I like this method but I don’t know if this is good or bad practise.


    #include <iostream>
    #include <string>
    #include <sstream>
    using namespace...
  24. Replies
    9
    Views
    2,050

    I saw from your previous thread that you were...

    I saw from your previous thread that you were struggling with functions.

    Here, the function menu() uses the return statement to return choice: Notice the function is declared above main() and...
  25. Replies
    19
    Views
    7,738

    Ah, real code, that’s what I’m looking for....

    Ah, real code, that’s what I’m looking for. Really appreciate you posting this, thank you. Beautiful.
Results 1 to 25 of 33
Page 1 of 2 1 2