Search:

Type: Posts; User: mortalc

Search: Search took 0.00 seconds.

  1. Thread: On Keypress

    by mortalc
    Replies
    5
    Views
    1,724

    Ok, I use windows, so I'm interested in these api...

    Ok, I use windows, so I'm interested in these api functions.

    I've foung the System.Windows.Form class and its method OnKeyPress(). Just a question before I try it out - How do I use things from...
  2. Thread: On Keypress

    by mortalc
    Replies
    5
    Views
    1,724

    Ok, that sort of works - I have to press a then...

    Ok, that sort of works - I have to press a then enter, and it executes the function twice. All I need now is to remove the need for an enter press.
  3. Thread: On Keypress

    by mortalc
    Replies
    5
    Views
    1,724

    On Keypress

    I have searched for this everywhere. The FAQ answer, as far as I can tell, just replicates cin.get().
    All I want is this: On a key press, ANY key press [NOT just enter], I want a specific function...
  4. Thread: Random Numbers

    by mortalc
    Replies
    19
    Views
    2,967

    Hrm... Maybe you're right.... How about this....

    Hrm... Maybe you're right....

    How about this. Say I'm going for a solver. Basically this is my idea:

    1. Open Xcel, or another grid program (I think I can do this with fopen())
    2. User writes...
  5. Thread: Grid

    by mortalc
    Replies
    7
    Views
    2,817

    OOOOOOOOOOOOOOOOOOOOOHHHHHHHHHH! I didn't know...

    OOOOOOOOOOOOOOOOOOOOOHHHHHHHHHH!

    I didn't know that it would stop at 7!
  6. Thread: Random Numbers

    by mortalc
    Replies
    19
    Views
    2,967

    I've edited my last post to show my full code.

    I've edited my last post to show my full code.
  7. Thread: Grid

    by mortalc
    Replies
    7
    Views
    2,817

    I'm not following you. surely sudoku[8][8] will...

    I'm not following you. surely sudoku[8][8] will be nine rows of
    [0][1][2][3][4][5][6][7][8]
  8. Thread: Grid

    by mortalc
    Replies
    7
    Views
    2,817

    I thought [8][8] is what I need, because it...

    I thought [8][8] is what I need, because it starts at [0][0]?
  9. Thread: Random Numbers

    by mortalc
    Replies
    19
    Views
    2,967

    I don't think so, because arrays start at 0....

    I don't think so, because arrays start at 0.
    I've solved the problem of the large numbers with this:



    if (sudoku[a][b]>9)
    {
    sudoku[a][b]=0;
    ...
  10. Thread: Random Numbers

    by mortalc
    Replies
    19
    Views
    2,967

    I am now using this code to create it: int...

    I am now using this code to create it:

    int sudoku[8][8] = {0};
    int i;
    int a;
    int b;
    srand(time(NULL));
    for(a=0;a<9;a++)
    {
    for(b=0;b<9;b++)
  11. Thread: Grid

    by mortalc
    Replies
    7
    Views
    2,817

    Grid

    I want to create a 9x9 grid for a sudoku program I'm making. I've got a randomly generated set of numbers stored in sudoku[8][8]. some will be a number between 1 and 9, others will be an empty value....
  12. Thread: Random Numbers

    by mortalc
    Replies
    19
    Views
    2,967

    If it is not between 1 and 9, I don't want it to...

    If it is not between 1 and 9, I don't want it to have a value; it is equivalent of the empty box in your sudoku puzzle.

    Aha-ha! I should have written


    printf("[%2d]", sudoku[a][b]);
  13. Thread: Random Numbers

    by mortalc
    Replies
    19
    Views
    2,967

    This is weird. Here is the main bit of my code: ...

    This is weird. Here is the main bit of my code:



    int sudoku[8][8];
    int i;
    int a;
    int b;
    srand(time(NULL));
    for(a=0;a<9;a++)
  14. Thread: Random Numbers

    by mortalc
    Replies
    19
    Views
    2,967

    So say if I use rand() %11; the highest will be...

    So say if I use rand() %11; the highest will be ten.
  15. Thread: Random Numbers

    by mortalc
    Replies
    19
    Views
    2,967

    Perfect! Now how do I limit it? Basically I...

    Perfect!

    Now how do I limit it? Basically I want to randomly generate a number between 0 and 9.
  16. Thread: Random Numbers

    by mortalc
    Replies
    19
    Views
    2,967

    Random Numbers

    Is there anyway at all of generating a random number?

    The function rand() just generates the name numbers in the same order every single time. For example,



    #include <stdio.h>
    #include...
  17. Replies
    5
    Views
    900

    Thanks! It works perfectly now! I have another...

    Thanks! It works perfectly now!

    I have another question. Different problem, same code. Should I ask it here or on a new thread? anyway, it is how to check if a char variable is a number. So for...
  18. Replies
    5
    Views
    900

    Ok, that got rid of the random characters. But...

    Ok, that got rid of the random characters. But it's still not running the actual differentiation process.
  19. Replies
    5
    Views
    900

    Something weird about Strings

    I have just started a code that will hopefully end up being able to differentiate any inputted function.
    It is relatively simple function, so at the moment it can only do powers. so

    x^3+x^2...
Results 1 to 19 of 19