Search
 
SCRIPT & CODE EXAMPLE
 

CSHARP

Tower of Hanoi c#

static void Move( int discs, Stack<int> fromPeg,  Stack<int> toPeg, Stack<int> otherPeg)
{
    if (discs == 0)
    {
        return;
    }

    Move(discs - 1, fromPeg, otherPeg, toPeg);

    toPeg.Push(fromPeg.Pop());

    Move(discs -1, otherPeg, toPeg, fromPeg);
}
Comment

PREVIOUS NEXT
Code Example
Csharp :: += meaning c# 
Csharp :: how to delay between lines in unity 
Csharp :: unity lock cursor to center 
Csharp :: unity set list of strings 
Csharp :: c# sql duplicate key exception 
Csharp :: c# split string for all blank character 
Csharp :: how to reference function in unity 
Csharp :: c# regex to find number between parenthesis 
Csharp :: net use delete 
Csharp :: c# reading months as int 
Csharp :: alphabet string[] c# 
Csharp :: key press up unity 
Csharp :: unity cast float to int 
Csharp :: how to encode and decode a string in c# 
Csharp :: c# font bold set 
Csharp :: c# start file 
Csharp :: cs entity framework 
Csharp :: c# datetime to timestamp 
Csharp :: c# update value in a json file 
Csharp :: c# string array initialization 
Csharp :: c# compile into an exe 
Csharp :: how to pause code execution in c# 
Csharp :: get hard disk serial number 
Csharp :: slider.onchanged in unity 
Csharp :: loop through string array c# 
Csharp :: unity keycode for f 
Csharp :: console.writeline c# 
Csharp :: c# minus days from datetime 
Csharp :: xamarin hide back button 
Csharp :: c# read file line by line 
ADD CONTENT
Topic
Content
Source link
Name
7+2 =