|
I need the code for Game "2048" so that always number 2 added.
Simple UI without graphic and program play not user.
Can anyone help me.
Thanks.
|
|
|
|
|
Please read the "How to get an answer to your question" pinned post on this forum:
"2. Be specific! Don't ask "can someone send me the code to create an application that does 'X'. Pinpoint exactly what it is you need help with."
« There is only one difference between a madman and me. The madman thinks he is sane. I know I am mad. » Salvador Dali
|
|
|
|
|
Wrong site - try rendacoder or freelancer or one of the I want codz sites. You will need to pay a minimal amount.
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
When you think about it what you're trying to create is, effectively, just some minor manipulation inside a grid. Now, what you want to consider is how could you represent a grid? Perhaps with a 2-D array. Then, you need to think about what the rules are. What you're trying to do is move tiles vertically or horizontally each time - that simplifies the code you have to write because you know that each operation affects only the rows or the columns.
So, you have rows and columns being manipulated. Let's consider the case where the user has swiped down so you're moving the rows down. Starting at the top row, when you move down this is always the way you'll work, start at the first element of that line of the array, and see if the first element of the line of the array below is the same number - if it is, you can increment it and blank out the current cell. You'll have to mark the cell that you just incremented so that you don't try to use it again - it's one increment per turn.
There, you have all the logic you need to get started. You should be able to extend this for swipe up and swipe left/right.
|
|
|
|
|
The game was (briefly) very popular, so predictably, it has lots of clones, in almost every language.
There is a C# version[^] with source code available too. It has a GUI (using System.Console), but I'm sure you can separate that out from the game logic.
I literally googled this in a couple of seconds, then browsed the source in maybe a minute. Writing this post took longer.
|
|
|
|
|
Hi,
I have a list as below
-Branch
Branchname = AB
BranchCode = 01
-Counters
-Countername = AB-1
Countercode = 101
countername = AB-2
countercode = 102
Branchname = CD
BranchCode = 02
-Counter
-Countername = CD-1
Countercode = 201
countername = CD-2
countercode = 202
i have 2 listboxes in UI, first list box should load all the branches and the second list box should have the corresponding counters for the selected branch.
Can anyone help me in binding the nested listbox to 2 listbox.
Thanks,
Rajeeva
|
|
|
|
|
There may be a way to do this with purely xaml but I would put the filtering in the viewmodel.
Assuming you know how to bind the collections to the listbox and get the selecteditem (bound twoway on the branch listbox)
In the selected item of the branch apply the branch filter to the counter collection and the UI will be updated!
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
Hi all, I have a web page that allows users to drag an image from their desktop on to a box that had been designated as a droppable box. Once the image is dropped it will be sent to a web service to be saved in a folder on the server. The following is the Javascript I'm using to send the image from the frontend to the webservice.
function ImageUpload(file) {
xhr = new XMLHttpRequest();
xhr.open('post', 'SaveImageService.asmx', true);
xhr.setRequestHeader('Content-Type', "multipart/form-Data");
xhr.setRequestHeader('X-File-Name', file.fileName);
xhr.setRequestHeader('X-File-Size', file.fileSize);
xhr.setRequestHeader('X-File-type', file.fileType);
xhr.send(file);
};
I am using the following code in my web service to save the posted image in a folder called Images. I'm not certain if the project folder name should be included as part of the folder path when I specify where to save the uploaded images. I tried including and excluding the project folder name but it didn't help.
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Services;
using System.IO;
using System.Drawing;
using System.Drawing.Imaging;
namespace ImageUpload
{
[WebService(Namespace = "http://tempuri.org/")]
[WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]
[System.ComponentModel.ToolboxItem(false)]
[System.Web.Script.Services.ScriptService]
public class SaveImageService : System.Web.Services.WebService
{
[WebMethod]
public void SaveImage()
{
var httpRequest = HttpContext.Current.Request;
foreach (string file in httpRequest.Files)
{
var postedFile = httpRequest.Files[file];
var filePath = HttpContext.Current.Server.MapPath("~/Images/" + postedFile.FileName);
postedFile.SaveAs(filePath);
}
}
}
}
I am getting response status of 500 internal server error. Please look at the code above and point out any problem you see. Thanks in advance for your help.
modified 25-Oct-14 9:21am.
|
|
|
|
|
As you are calling this using AJAX, then do you have the SaveImageService registered in the ScriptManager control on your ASPX page?
Christopher Reed
"The oxen are slow, but the earth is patient."
|
|
|
|
|
Hi, thanks for responding. The web service is not registered in the Scriptmanager control and there is no ASXP page.
|
|
|
|
|
I think your issue is in your loop. Try:
foreach (string file in httpRequest.Files.AllKeys)
|
|
|
|
|
Hello,
I am getting an error 0xC0000006 when starting program that normally starts up and runs fine. It is being
executed from a network drive. I am working with .NET 2.0, however some machines that I am using have
the .NET 3.5 or .NET 4.0 runtime installed. The machines that are giving the errors are running Windows 7
Professional.
Any help or advice is appreciated.
|
|
|
|
|
You MUST have .NET 2.0 installed and, by default, code running from network sources is not trusted. Your code is running in a very restricted sandbox.
So, either you have to tell the machine to trust the network source, or move the .EXE to the local hard drive and run it from there. Running from a network source isn't the greatest idea if you're going to be replacing the .EXE since the file is locked when the code is running on any machine.
|
|
|
|
|
Dave,
Thank you for your response.
How do I go about telling the machine to trust the network source? Is this procedure common for all versions of Windows? (XP, Win7, Win8, Win10, etc). I don't think putting the EXE on a local drive is a good option in our case. For updates, I would have to go to every machine and update. Another vendor, which we interface with their software, they put everything on the network with no problems.
Mike
|
|
|
|
|
look for instruction/how to use 'CasPol.exe' and see if that gives you the options
Control Panel->Administrative Tools->.NET Framework Configuration ?.?->Runtime Security Policy->Adjust Zone Security might also be of some use
|
|
|
|
|
Is there something I'm misisng? I tried this and it still does not correct the problem. I had to use the caspol from the cmd line, using the guidelines seen here:
<a href="https://julianscorner.com/wiki/programming/caspol_network_share">
</a>[<a href="https://julianscorner.com/wiki/programming/caspol_network_share" target="_blank" title="New Window">^</a>]
Any other hints?
Thanks
Mike
|
|
|
|
|
|
Hello,
I am receiving an "Application has stopped working" error in my C# WinForms application. The running OS versions are Windows 7 Home Premium, Windows 7 Professional and also a few WinXP Home machines. I have an exception handler set up in my code:
public void MyExceptionHandler
(Object sender, ThreadExceptionEventArgs e)
{
MessageBox.Show("Internal Error" +
"\r\n\r\n" +
e.Exception.Message + "\r\n\r\n" +
"Stack Trace: " + e.Exception.StackTrace, "Oslermedicine® Manager Notification");
}
This code is never called for some reason and Windows handles any errors.
I set up the ThreadException in my _load event for the main form:
Application.ThreadException += MyExceptionHandler;
What would cause this behavior?
I tried to put it in the main loop but then the program becomes very unstable, crashing on other handlers.
Thanks
Mike
|
|
|
|
|
There is also an "UnhandledException" delegate in the Application class that you should assign your handler to.
The difficult we do right away...
...the impossible takes slightly longer.
|
|
|
|
|
Does anyone have any code for CRC8 calculation and polynomial calculation?
I'm trying to learn about this and having code to see it works would really help me.
Thank you.
|
|
|
|
|
CodeProject is your friend: "C# CCITT-8 CRC Algorithm:" [^].
There are three other articles on CRC8 on CodeProject: just search for them.
« There is only one difference between a madman and me. The madman thinks he is sane. I know I am mad. » Salvador Dali
|
|
|
|
|
|
If you found the CodeProject implementation, you can always ask questions on the article forum. That's what it's there for.
|
|
|
|
|
If someone could help me with this example [^] I would really appreciate that.
I'm not sure how to get it working, or why the author used "1, 2, 3" in the example. I would like to pass hex values.
|
|
|
|
|
turbosupramk3 wrote: I had some trouble with them and wanted to be able to ask questions so I posted here. Well, why aren't you asking specific questions based on the difficulties you are having with working with codes in the resources you found ?
We can't read your mind, and, in general, the more specific the question is, here, the more likely the poster is to get a satisfying answer, quickly.
Of course, if you are working with complex code you didn't write yourself, you may be getting error messages, or crashes, as you attempt to modify/use the code, and, possibly, only the author of the resource may be able to help you. In the case of CP articles/resources, as Pete points out, you can post a question to the author.
« There is only one difference between a madman and me. The madman thinks he is sane. I know I am mad. » Salvador Dali
|
|
|
|