16,016,557 members
Sign in
Sign in
Email
Password
Forgot your password?
Sign in with
home
articles
Browse Topics
>
Latest Articles
Top Articles
Posting/Update Guidelines
Article Help Forum
Submit an article or tip
Import GitHub Project
Import your Blog
quick answers
Q&A
Ask a Question
View Unanswered Questions
View All Questions
View C# questions
View C++ questions
View Javascript questions
View Visual Basic questions
View .NET questions
discussions
forums
CodeProject.AI Server
All Message Boards...
Application Lifecycle
>
Running a Business
Sales / Marketing
Collaboration / Beta Testing
Work Issues
Design and Architecture
Artificial Intelligence
ASP.NET
JavaScript
Internet of Things
C / C++ / MFC
>
ATL / WTL / STL
Managed C++/CLI
C#
Free Tools
Objective-C and Swift
Database
Hardware & Devices
>
System Admin
Hosting and Servers
Java
Linux Programming
Python
.NET (Core and Framework)
Android
iOS
Mobile
WPF
Visual Basic
Web Development
Site Bugs / Suggestions
Spam and Abuse Watch
features
features
Competitions
News
The Insider Newsletter
The Daily Build Newsletter
Newsletter archive
Surveys
CodeProject Stuff
community
lounge
Who's Who
Most Valuable Professionals
The Lounge
The CodeProject Blog
Where I Am: Member Photos
The Insider News
The Weird & The Wonderful
help
?
What is 'CodeProject'?
General FAQ
Ask a Question
Bugs and Suggestions
Article Help Forum
About Us
Search within:
Articles
Quick Answers
Messages
Comments by Member 10540766 (Top 17 by date)
Member 10540766
16-Feb-14 17:59pm
View
Im not sure i understand what you mean?
Printf would not output anything either
Member 10540766
13-Feb-14 20:24pm
View
I have tested the remove method and it removes perfectly, but does not output the strings such as:
else
{
current.next.prev = current.prev;
current.prev.next = current.next;
current.prev = null;
current.next = null;
Output += "\r\n" + "Node removed from Doubly Linked List" + "\r\n";
}
Also i noticed the find method does not output anything either
Member 10540766
13-Feb-14 18:33pm
View
In the remove i want it to remove a node and return a string saying if it worked or not, is it bad to code it that way?
Member 10540766
12-Feb-14 2:51am
View
Thanks Bill!, but where would i move the find and remove codes to get it to work?
Member 10540766
10-Feb-14 21:57pm
View
Im having trouble following the code even with a breakpoint, any advice on an easier way to follow it? Or to write it out step by step??
Member 10540766
6-Feb-14 0:40am
View
Ok so for each number in the Hanoi(1,2,3,3); we run the 3 sub branches?
Eg; for Hanoi(1) its:
Hanoi(Tower1, Tower3, Tower2, n - 1);
Hanoi(Tower1, Tower2, Tower3, 1);
Hanoi(Tower2, Tower1, Tower3, n - 1);
The first line would be n(3)-1 which is 2, but i dont get what im doing with the sub branches.
First line = ?
Second line = ?
Third line = ?
Then for Hanoi(2) and (3) i still dont get it, but by understanding what happens in the first call i will understand the rest.
Can you please explain that one?
Member 10540766
5-Feb-14 22:21pm
View
Ok so for each number in the Hanoi(1,2,3,3); we run the 3 sub branches?
Eg; for Hanoi(1) its:
Hanoi(Tower1, Tower3, Tower2, n - 1);
Hanoi(Tower1, Tower2, Tower3, 1);
Hanoi(Tower2, Tower1, Tower3, n - 1);
The first line would be n(3)-1 which is 2, but i dont get what im doing with the sub branches.
First line = ?
Second line = ?
Third line = ?
Then for Hanoi(2) and (3) i still dont get it, but by understanding what happens in the first call i will understand the rest.
Can you please explain that one?
Member 10540766
5-Feb-14 2:09am
View
I understand that it is calling itself over and over until the conditions are met, but i am trying to understand if:
Hanoi(1, 2, 3, 3);
means that n = 1 then 2 then 3 then 3.
Or if its
Hanoi(int Tower1, int Tower2, int Tower3, int n)
Hanoi(1, 2, 3, 3);
Meaning that tower1 = 1, tower2 = 2, tower3 = 3, n = 3 ?
Member 10540766
23-Jan-14 23:43pm
View
I keep getting errors, going to prob re-do like all the code again from scratch..This stuff doeesnt work at the moment.
int[,] toys = new int[4, 5];
for (int week = 0; week <= 3; week++)
{
for (int day = 0; day <= 4; day++)
{
int tempVal = 0;
if (int.TryParse(Microsoft.VisualBasic.Interaction.InputBox("Please enter value for Day " + (day + 1) + " in week " + (week + 1) + "."), out tempVal))
{
toys[day, week] = tempVal;
}
else
{
MessageBox.Show("Invalid entry");
day--;
continue;
}
string headerFormat = "\t\tMon\tTue\tWed\tThur\tFri\n";
string lineFormat = "Week {0}\t{1}\t{2}\t{3}\t{4}\t{5}\n";
txtOutput.Text = headerFormat;
for (week = 0; week < 4; week++)
{
txtOutput.AppendText(string.Format(lineFormat, week + 1, toys[week, 0], toys[week, 1], toys[week, 2], toys[week, 3], toys[week, 4]));
}
The tempval stuff causes it to crash atm
Member 10540766
23-Jan-14 23:13pm
View
So basically to keep it 5,4 i have to change the top for loop to day/week in all loops.
Otherwise is must be 4,5 and week/day ?
Thanks for all the help so far Ron!
Member 10540766
23-Jan-14 22:15pm
View
Doesn't 5,4 come out like this.
http://i.stack.imgur.com/LZu7u.jpg
Member 10540766
23-Jan-14 22:01pm
View
That also comes up with outside the bounds of the array.
Its weird because the array is like this up top:
int[,] toys = new int[5, 4];
for (int week = 0; week <= 3; week++)
{
so when i tried ur code it came up with outside bounds :/
Member 10540766
23-Jan-14 21:47pm
View
That seems to fix that issue, now i tried mixing up the for loop to change things up.
If i run ur code it gives me "Index was outside the bounds of the array."
If i run this it gives me "Index (zero based) must be greater than or equal to zero and less than the size of the argument list."
for (week = 0; week < 3; week++)
{
txtOutput.AppendText(string.Format(lineFormat, week + 1, toys[week, 0], toys[week, 1], toys[week, 2], toys[week, 3]));
Im trying to make it all make sense
Member 10540766
23-Jan-14 21:33pm
View
Didn't think it was that obvious. :)
Btw, with week 0,1,2,3,4. Does that output it as Week 0, Week 1 ... etc?
Because techincally i have Week 1-4 only in the array
Member 10540766
23-Jan-14 21:15pm
View
Yeah checking it out now, but this gives me the same weird message "A local variable named 'week' cannot be declared in this scope because it would give a different meaning to 'week', which is already used in a 'parent or current' scope to denote something else" in the for int week part
Member 10540766
23-Jan-14 20:49pm
View
will do, thanks Ron
Member 10540766
23-Jan-14 20:17pm
View
Oh so i had to make a temp value and then do the int.parse of the whole inputbox to that?
I was trying to int.parse within the inputbox which must have been the issue.
Thank you :)
Show More