Search:

Type: Posts; User: samwillc

Page 1 of 6 1 2 3 4

Search: Search took 0.01 seconds.

  1. Replies
    1
    Views
    858

    This is a very old thread! I haven't played with...

    This is a very old thread! I haven't played with C++ for quite awhile but I imagine instead of going from 1 attempts to 3, maybe reverse that and start at 3 and use that counter as a text prompt....
  2. Replies
    2
    Views
    3,381

    Can try this thread:...

    Can try this thread: http://cboard.cprogramming.com/cplusplus-programming/155785-implement-source-code-turns-numbers-into-english-text.html

    Maybe this will give you some pointers.
  3. Replies
    15
    Views
    1,463

    Yes, 'or' on those three conditions would have...

    Yes, 'or' on those three conditions would have always have been true whatever a user entered so the loop would always run. All three needed to be 'and'. I'm glad you got it sorted :)
  4. Replies
    15
    Views
    1,463

    Hi tsdad. I don't believe you actually...

    Hi tsdad.



    I don't believe you actually need an if statement in this situation, or a break. The loop itself handles the conditions because it will only exit once a correct option has been...
  5. Replies
    9
    Views
    2,451

    I use my calculator all the time! :p

    I use my calculator all the time! :p
  6. Replies
    4
    Views
    1,338

    Aha, that makes more sense, thanks for the...

    Aha, that makes more sense, thanks for the explanation :)
  7. Replies
    4
    Views
    1,338

    Something like this? srand =...

    Something like this?

    srand = 16,867,565,532,618,582,454,987,265

    So on first run:

    srand = 16,867,565,532,618,582,454,987,265

    54,987 being returned as the random number from rand(). And on...
  8. Replies
    4
    Views
    1,338

    Two questions regarding srand

    Hi everyone,

    From jumping into C++, there is this code:



    #include <ctime>
    #include <cstdlib>
    #include <iostream>
  9. Replies
    9
    Views
    2,451

    If you use an integer, if your friend types in...

    If you use an integer, if your friend types in 3.57 for the radius, it will be saved as 3, which will give you an inaccurate result.

    I used PI as 3.142 as an approximation as grumpy said. Press...
  10. Replies
    9
    Views
    2,451

    The volume is: 3.142 x (radius x radius) x...

    The volume is:



    3.142 x (radius x radius) x height
    [code]

    What about a couple of floats for the radius and height values.

    [code]
  11. Replies
    25
    Views
    1,984

    Thanks for all the input. I have been busy the...

    Thanks for all the input. I have been busy the past few days and not had a chance to look at arrays. I will carry on over this weekend, then eventually get back to that tic tac toe game!
  12. Replies
    25
    Views
    1,984

    Ah, I think I see. BoardPos.at(5) =...

    Ah, I think I see.



    BoardPos.at(5) = BoardPos_t::X;


    would be written instead of:
  13. Replies
    25
    Views
    1,984

    Sorry, I edited before you posted again. ...

    Sorry, I edited before you posted again.



    enum TicTacToeSquare {circle, cross, blank}


    Then what is the value of cross, circle, blank here?

    *EDIT*
  14. Replies
    25
    Views
    1,984

    I will look at the link :) and try to work this...

    I will look at the link :) and try to work this out.



    1) If a user inputs a 4
    2) int boardPos4 is updated to a circle (which is enum value 2);
    3) If I now std::cout boardPos4 to show a circle...
  15. Replies
    25
    Views
    1,984

    Yes, this is how I would expect it too, so I need...

    Yes, this is how I would expect it too, so I need to find a way to show 0,1 or 2 as a 'X', 'O' or blank. I will look at your post in more detail later and practice more with arrays. I haven't...
  16. Replies
    25
    Views
    1,984

    I will go away and research into this. I think...

    I will go away and research into this. I think otherwise this thread will go on forever.

    I am aware that a game can be finished before all the squares are filled up but I had no idea what a 'cats...
  17. Replies
    25
    Views
    1,984

    I'm still working on arrays but let's just say I...

    I'm still working on arrays but let's just say I have a bunch of integers for now. This is how I imagine it working if this helps to clarify my position:

    Board is blank, this is shown on screen:
    ...
  18. Replies
    25
    Views
    1,984

    You're right, in a real life scenario, but if I...

    You're right, in a real life scenario, but if I was playing this game online gor example, I would expect the squares to be numbered to show which one to choose. Rather that than choose a row 1-3,...
  19. Replies
    25
    Views
    1,984

    In reality, if I physically have a board in front...

    In reality, if I physically have a board in front of me, the squares are blank. I couldn't put a cross where there is already a cross. I couldn't put a circle where there is already a circle. I can...
  20. Replies
    25
    Views
    1,984

    Ok, so I'm getting there after getting...

    Ok, so I'm getting there after getting sidetracked with enums. I only have a few problems left now.



    #include <iostream>

    char gameBoard [3][3] = {{'1', '2', '3'}, {'4', '5', '6'}, {'7', '8',...
  21. Replies
    24
    Views
    2,079

    Thanks to all who have helped so far. So I have...

    Thanks to all who have helped so far. So I have put this together with the snippets outlined along the way.



    #include <iostream>
    #include <string>

    enum CarType {CT_FORD, CT_MUSTANG,...
  22. Replies
    24
    Views
    2,079

    I think this is happening right now. I...

    I think this is happening right now.



    I thought that may be the case after watching the video again, a normal return value (as I have used) would also 'put back in main' or however he puts it....
  23. Replies
    24
    Views
    2,079

    If I recorded myself saying this, added noise and...

    If I recorded myself saying this, added noise and then played it back to myself in reverse, it would make as much sense as this does to me at my stage of learning. I will come back to this in a years...
  24. Replies
    24
    Views
    2,079

    Thanks everyone. I will try the examples later...

    Thanks everyone. I will try the examples later after work.
  25. Replies
    24
    Views
    2,079

    I'm trying hard to understand this (so I can use...

    I'm trying hard to understand this (so I can use it in my tic tac toe game)! I will try to explain my problem a bit further. The thing I don't get is this:



    #include <iostream>

    int main()...
Results 1 to 25 of 128
Page 1 of 6 1 2 3 4