Search:

Type: Posts; User: maybabier

Page 1 of 2 1 2

Search: Search took 0.01 seconds.

  1. Replies
    10
    Views
    3,617

    I wanted to see if rand can generate two...

    I wanted to see if rand can generate two dimensions like
    numbers [] []
    and make sure they are not repeating. ex: row != row && col != col.
    should i just add another for loop under


    for(c = 0;...
  2. Replies
    10
    Views
    3,617

    i don't quit understand how this part works ...

    i don't quit understand how this part works


    do
    {
    ball = random() % RANGE;
    }
    while(numbers[ball]);
  3. Replies
    10
    Views
    3,617

    randomly generate numbers

    this program draws random lotto numbers using arrays.
    it does make sure the numbers don't repeat.
    I want to know how to write it as a 2D array.

    heres the code


    #include <stdio.h>
    #include...
  4. Replies
    4
    Views
    856

    That was magical! Thanks I thought I should...

    That was magical!
    Thanks
    I thought I should pass the pointer value, and the pointer value will change according to entry. then it will change the value where it points to.
    What's the difference?
  5. Replies
    4
    Views
    856

    Sagmentation Fault pls help!

    I'm writing a program that detects character entry and move a submarine that's on the display. here is the move code.
    h moves left, j moves down, k moves up, l moves right.
    the ocean is a 6x15 box....
  6. Replies
    1
    Views
    1,460

    it won't print the 0 if i enter 102

    #include "presults.h"
    #include "display.h"
    #include "chrutil.h"


    int put_result(int ans)
    /* This function is given an integer and prints it one digit at a time
    either to the calc display or...
  7. Replies
    3
    Views
    2,703

    aha! i got it! thank you very much!

    aha!
    i got it!
    thank you very much!
  8. Replies
    3
    Views
    2,703

    sorry.. i don't quite get the code. ch is...

    sorry.. i don't quite get the code.
    ch is defined as int?
    what does it mean when its != 1.
  9. Replies
    3
    Views
    2,703

    scanf to read int but read in char?

    I am writing a program that:

    scanf is set to read in an integer value,
    when it reads char it goes into an infinite loop.
    The program should instead, print an error msg and break out of the loop....
  10. Replies
    18
    Views
    5,338

    this is my new idea: in main: while (num !=...

    this is my new idea:


    in main:
    while (num != EOF)
    if !is_hawaiian, print invalid
    else, print valid

    in is_hawaiian:
    ch=getchar()
  11. Replies
    18
    Views
    5,338

    hmmm. that's big help! thank you so much! i...

    hmmm. that's big help!
    thank you so much!
    i just saw that...
    i am not really familiar with those character things, i think i will read the book more and spend a few more hours on this.
    i'm...
  12. Replies
    25
    Views
    3,959

    ohh you guys are so helpful. i usually am really...

    ohh you guys are so helpful.
    i usually am really neat about how i write the codes,
    but when i get frustrated i just add on and erase where ever till i get it to work then fix it.

    about...
  13. Replies
    25
    Views
    3,959

    gotcha! Thanks so much

    gotcha!
    Thanks so much
  14. Replies
    25
    Views
    3,959

    I just have one question. Why does it make a...

    I just have one question.
    Why does it make a difference?
    It's in the same function!!!
  15. Replies
    25
    Views
    3,959

    Seems like you are right. I moved the statement...

    Seems like you are right.
    I moved the statement if it's not roman down with the statement EOF, it works now....
    I'm gonna test more data, hopefully it works for everything!
  16. Replies
    25
    Views
    3,959

    Hmm. I know. I worked on this yesterday...

    Hmm. I know.
    I worked on this yesterday afternoon for like 5 hours.
    now for 3 more. still can't get this thing to work.
    I found something though,
    it seems like if i enter XXXXA, it prints 40.
    if...
  17. Replies
    18
    Views
    5,338

    main() { char ch; char...

    main()
    {
    char ch;
    char last_ch;
    int inword;
    int hi;

    /* we are not in the word at the beginning */
    inword = FALSE;
    /* ...
  18. Replies
    25
    Views
    3,959

    I have found more problems now.. Oh I hate this....

    I have found more problems now.. Oh I hate this.

    Enter an number in roman numerals(EOF to quit): cccccccccccccaddddddd
    The number is 1300
    Enter an number in roman numerals(EOF to quit): The...
  19. Replies
    25
    Views
    3,959

    I included while(!is_roman(rdigit) &&...

    I included


    while(!is_roman(rdigit) && !IS_WHITE_SPACE(rdigit) && rdigit != EOF) return 0;


    in get_roman should get it taken care of...
    not sure....
  20. Replies
    25
    Views
    3,959

    but even in get_roman function, when it reads an...

    but even in get_roman function, when it reads an invalid, return 0,
    0 should update the "number" value and it should just print error.
    what am i missing?
  21. Replies
    25
    Views
    3,959

    I've been messing with main(). It seems like...

    I've been messing with main().
    It seems like everything should be in a loop.
    It makes sense to me that if it reads an invalid it should only print error.



    #include <stdio.h>
    #include...
  22. Replies
    18
    Views
    5,338

    this is where delimitp located. #include...

    this is where delimitp located.




    #include <stdio.h>
    #include "tfdef.h"
    #include "chrutil.h"

    /* Function returns TRUE if c is a delimiter, otherwise FALSE */
  23. Replies
    25
    Views
    3,959

    You are correct. enter VCZ, When Z is read, the...

    You are correct.
    enter VCZ,
    When Z is read, the program should ignore the "VC" calculation and just print error.
    (mine prints the result of VC instead of error)
    If there is any non roman numeral,...
  24. Replies
    18
    Views
    5,338

    it's skipping every other character, doesn't...

    it's skipping every other character, doesn't matter what it is..........
    i wish it would understand me more... >_<
    so frustrating!
  25. Replies
    25
    Views
    3,959

    while(!is_roman(rdigit) &&...

    while(!is_roman(rdigit) && !IS_WHITE_SPACE(rdigit) && rdigit != EOF) return 0;


    it returns 0 when it detects a non roman digit and it's not white space or ctrl d.

    the while loop you quoted...
Results 1 to 25 of 30
Page 1 of 2 1 2