Search:

Type: Posts; User: mszegedy

Page 1 of 2 1 2

Search: Search took 0.01 seconds.

  1. Wooow. That's exactly the sort of thing that I'm...

    Wooow. That's exactly the sort of thing that I'm looking for! Thanks, it's always good to learn new things. Jesus, this is pretty spot-on. That's brilliant. Thanks a lot! Oh, and it seems you know...
  2. Yeah, sorry, I meant to && them. :P I'm so...

    Yeah, sorry, I meant to && them. :P I'm so absentminded sometimes... it's all a moot point, though, because I'm using isdigit(num [i]) now.
  3. I don't want to make my variables global, though,...

    I don't want to make my variables global, though, and I'm not very good with pointers to arrays. I guess I could make it return the value to put into current, though! Thanks, I'll try that.


    ...
  4. I'm sure I can solve this with a function I haven't heard about yet.

    Hi,

    So, I have a file parser that, at one point, takes input of the form of "h(124) c(566) f(178)" and reads it into variable array current [7]. It will only accept l(), h(), a(), v(), c(), or...
  5. I'm the only person using the program: there's no...

    I'm the only person using the program: there's no point in sanitizing the input if I make sure not to do anything stupid.

    @patricio2626: For your first suggestion, it went up to 30 and then...
  6. At this point I've replaced it with a separate...

    At this point I've replaced it with a separate function. No good, but cleaner. Looking at a compilation of the older code, it's... the same thing as tmpxp1. Huh.
  7. But it crashes before even a single iteration....

    But it crashes before even a single iteration. It's not like it's 10000000000000 or anything. It's 100. I get the same error if I use 123 as the seed.

    (If there's a simpler way to get the nth...
  8. Urr, I got it to compile again but it still says...

    Urr, I got it to compile again but it still says I'm dividing by zero. I swear I'm not! I specifically raised initial n to 2 to combat this nonsense. I'm passing ints into modulus and everything......
  9. Thanks for the explanation! It doesn't exactly...

    Thanks for the explanation! It doesn't exactly work yet: modulus is being highlighted as only taking doubles, which makes no sense, but thanks a lot! I think I know what I'll try, then...
  10. But why do they need to be doubles? D:

    But why do they need to be doubles? D:
  11. Darn it. I was suspecting this, so I looked it...

    Darn it. I was suspecting this, so I looked it up, and I concluded that ^ means exponent. But, now that I think about it, must've meant bitwise AND. What's exponent?

    EDIT: Looked up exp (x, y),...
  12. Weird arithmetic failure on perfectly legit operation.

    Here is my code. Its purpose is to test my method for generating pseudorandom numbers for my diamond-square algorithm terrain generator. It was supposed to be a proof-of-concept, to see whether the...
  13. Thread: Blood Typing

    by mszegedy
    Replies
    4
    Views
    2,679

    Well, I was originally gonna have g_b_t return an...

    Well, I was originally gonna have g_b_t return an array of chars, but it refused to accept that, so it was made into a global variable.

    Maybe I'd be better off writing this in Lisp... :P
  14. Thread: Blood Typing

    by mszegedy
    Replies
    4
    Views
    2,679

    Blood Typing

    Here's a blood typing program I wrote on a sick bag on an airplane; it's been giving me mounds of trouble. The latest development is that when I try to print the blood types it doesn't show anything....
  15. Replies
    7
    Views
    2,576

    First off, EOF is not a valid variable- I haven't...

    First off, EOF is not a valid variable- I haven't found it declared anywhere in the program (Unless there's a reserved C command I should know about?), so I'm assuming you attempted to multiply...
  16. Replies
    7
    Views
    2,576

    Ooh, this sounds fun. I love genetics. I won't...

    Ooh, this sounds fun. I love genetics. I won't actually write the code for you, but I'll definitely create a version for myself and if you have any bugs we'll compare.
  17. Replies
    6
    Views
    1,758

    Yep. The first time you define computesums has to...

    Yep. The first time you define computesums has to match up with the second time you define computesums. Change the argument of the first definition to match the second definition. Alternatively, you...
  18. Replies
    9
    Views
    1,547

    Uh, forget it. I fixed everything. You can close...

    Uh, forget it. I fixed everything. You can close this topic (can you forgive me for posting three times in a row? It's not to increase my postcount, but to alert people that something new has become...
  19. Replies
    9
    Views
    1,547

    Wait. I fixed something in main. Now it looks...

    Wait. I fixed something in main. Now it looks like:


    int main()
    {
    char a; // Input for player.
    setsafe(); // Sets the char representation of the safe to 0, 1, 2 ... 9. Also sets num to a...
  20. Replies
    9
    Views
    1,547

    I'm using xcode's built-in C compiler. I'm not...

    I'm using xcode's built-in C compiler. I'm not sure how to make it compile with C99. Plus, I'm not really using it as a bool anymore. I'm using it to store two bits (numbers 0-2), rather than a...
  21. Replies
    9
    Views
    1,547

    New problem. See edited first post.

    New problem. See edited first post.
  22. Replies
    19
    Views
    3,047

    Yes. So, I believe this topic can be closed.

    Yes. So, I believe this topic can be closed.
  23. Replies
    19
    Views
    3,047

    I was simply remarking on how inappropriate his...

    I was simply remarking on how inappropriate his tone was (not to be hypocritical, but if someone said that in real life to some guy who just wanted help I would definitely shout, "Oi, shut up!" at...
  24. Replies
    19
    Views
    3,047

    Wait, he's offline. I'd better go to sleep (it's...

    Wait, he's offline. I'd better go to sleep (it's 3:30 AM where I am).
  25. Replies
    19
    Views
    3,047

    Yes, telling someone (s)he is "wasting our time"...

    Yes, telling someone (s)he is "wasting our time" is a very quick and efficient way of solving a problem.

    Perhaps (s)he doesn't know what his/her compiler is trying to tell him/her. It is very hard...
Results 1 to 25 of 31
Page 1 of 2 1 2