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...
Type: Posts; User: mortalc
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...
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.
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...
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...
OOOOOOOOOOOOOOOOOOOOOHHHHHHHHHH!
I didn't know that it would stop at 7!
I've edited my last post to show my full code.
I'm not following you. surely sudoku[8][8] will be nine rows of
[0][1][2][3][4][5][6][7][8]
I thought [8][8] is what I need, because it starts at [0][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;
...
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++)
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....
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]);
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++)
So say if I use rand() %11; the highest will be ten.
Perfect!
Now how do I limit it? Basically I want to randomly generate a number between 0 and 9.
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...
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...
Ok, that got rid of the random characters. But it's still not running the actual differentiation process.
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...