- Strength to Increase Rep
- +0
- Strength to Decrease Rep
- -0
- Upvotes Received
- 8
- Posts with Upvotes
- 8
- Upvoting Members
- 7
- Downvotes Received
- 0
- Posts with Downvotes
- 0
- Downvoting Members
- 0
21 Posted Topics
Here's the basic structure you want to aim for: After the person has taken their go, rotate the go for the next user (like multi-player). Now write an AI function or class that returns the position in the array where the AI would like to go. Set the position in …
I thought you meant selecting the second largest divisor of 2 numbers, in which case something along the lines of: [code] static int GetSecondDivisor(int num1, int num2) { List<int> divisors1 = new List<int>(); List<int> divisors2 = new List<int>(); List<int> overlaps = new List<int>(); int divisorIndex = 2; for (int i …
I am designing an instant messanger and I am using tabs to allow for multiple chats to be taking place in the same windows form. When a new chat is opened, a new tab is added, using a User Control to make the new tab contain all of the required …
The error in the thread title is caused when you try and compare a string with an int. The standard way to resolve this is to put .ToString() on the end of the int. e.g. [code] int num = 1; string text = "1"; if(num == text) [/code] Here, the …
Posted above is not a class, instead he has suggested you use a method which is called by simply: text = FilterText(text); (as it says in his post) Note that a method comes inside a class, e.g. [CODE] Class Program { static void Main() { string text = "text"; text …
OK, basically I want to test if the shift key is pressed. The method i've tried (unsuccessfully) is [CODE] private bool shiftPressed = false; private void CheckKeys(object sender, KeyPressEventArgs e) { //If enter is pressed and shift isn't //This allows for line breaks in a message by pressing shift & …
OK, so i've written a server to listen to TCP connections, and send a response. It can be connected to via telnet and works fine. Next, i started writing the client side of the application - I started out simple by trying the following: [CODE] public static void Send2(Server server) …
Ok, I'm trying to pass some variables from inside Form1, to a new form: LoginDetails. Essentially, what this code does is check if a file exists. If it does, it loads the values from within the file. If the file loads correctly, (it should contail login details to a server) …
I am relitively new to C#. On thursday I started out writing a Tic-tac-toe game. Just a basic gridbuilder, ask the user where they want to go, alternate the users, as player2 where he wabts to go (checking if the move is 'legal'). I've just kept adding to it... This …
Fix is @ ln10: [CODE] Console.WriteLine(value); [/CODE] You are priniting the random variable in your code, not the indexed value of the array
[QUOTE=ddanbe;1083072]Hey! Way back I made a metronome with it! Very proud when after some soldering it actually worked.:icon_biggrin: Don't know if the 555 is still popular today...[/QUOTE] Most certainly is. Last used one in an egg timer :p But they are still the #1 timing IC around
Unless Adobe are using magic, it is simply a memory/cpu tradeoff. 1. CPU Hungry - Store 1 raw image & 1 changed image, apply all changes every time a single change is made. 2. Memory hungry - Store 1 copy to be displayed & 1 copy for every transformation. Each …
Defragging is best left to defragging programs. C# isn't exactly geared up for making a defrag program due to low level hdd access requirements. Consider calling the windows defrag program or another piece of 3rd party software to do the defragmentation itself. How to call processes: [code] using System.Diagnostics; ... …
This is really just a client-server model issue. With the web you must contact the server to check for updates, rather than the server alerting you of updates. So, for this to work with a 'standard' webpage you must get the page from the server and do the comparison. If …
The file type ascociation is handled by the OS, not the program. What you must do is create your program with a bit of code that allows for the file path to be passed as an argument. Then ascociate the compiled executable with the filetype you will be using. think …
The key here is really that you say you are reading data for another purpose. It is more manageable to have one file hold data for one thing. If you are certain you want to have both sets of data in one file sknake's post contains all you need :)
Printing One Text Box: [code] public void PrintDocument() { //Create an instance of our printer class PCPrint printer = new PCPrint(); //Set the font we want to use printer.PrinterFont = new Font("Verdana", 10); //Set the TextToPrint property printer.TextToPrint = Textbox1.Text; //Issue print command printer.Print(); } [/code] As you can see …
Depending on what, porecisely you are trying to do and whether the server is public or private (for security purposes) you may also want to consider calling a windows ssh client such as putty and pasing it the variables to connect to the server & run a command. Or of …
Perhaps the best place to start is to add a line break after each ts.Write called. Now you can see each individual piece of data. Make the first 2 lines a dump of paintSequence.GetLength(1) & paintSequence.GetLength(2). Then all you have to do is think of your 2d array as an …
Just a fix on jonsca's code: [code] for (int i = 0; i < firstArray.GetUpperBound(0); i++) for (int j = 0; j < firstArray.GetUpperBound(1); j++) firstArray[i, j] = ??; [/code] The less than or equal to comparitor should just be less than, else you'll be reading/writing outside of the arrays …
The End.
Medalgod