Question
If possible, this tower of hanoi code is written in java. Could anyone make an attempt to write it in python? package Hanoi; import java.util.Scanner;
If possible, this tower of hanoi code is written in java. Could anyone make an attempt to write it in python?
package Hanoi; import java.util.Scanner; private int n,current,r; public class Towers { private Scanner in; private int[] hasItMoved,toDest; Towers(){ this.in=new Scanner(System.in); this.current=1; System.out.println("Enter the number of disks: "); this.n = in.nextInt(); this.hasItMoved=new int[12]; this.toDest=new int[12]; for(int j=0;j
Hanoi.java
package Hanoi; public class Hanoi { public static void main(String[] args) { Towers test=new Towers();}}
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started