tp2
This commit is contained in:
		
							
								
								
									
										1
									
								
								.gitignore
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										1
									
								
								.gitignore
									
									
									
									
										vendored
									
									
								
							@ -1,2 +1,3 @@
 | 
			
		||||
__pycache__/
 | 
			
		||||
*.tar
 | 
			
		||||
*.class
 | 
			
		||||
 | 
			
		||||
							
								
								
									
										
											BIN
										
									
								
								project/bonnes-pratiques.pdf
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										
											BIN
										
									
								
								project/bonnes-pratiques.pdf
									
									
									
									
									
										Normal file
									
								
							
										
											Binary file not shown.
										
									
								
							
							
								
								
									
										8
									
								
								q2/cours3/test.java
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										8
									
								
								q2/cours3/test.java
									
									
									
									
									
										Normal file
									
								
							@ -0,0 +1,8 @@
 | 
			
		||||
public class test {
 | 
			
		||||
	public String testM(){
 | 
			
		||||
		return "yay";
 | 
			
		||||
	}
 | 
			
		||||
	public static void main(String[] args) {
 | 
			
		||||
		System.out.println(testM());
 | 
			
		||||
	}
 | 
			
		||||
}
 | 
			
		||||
							
								
								
									
										21
									
								
								q2/cours6/Question.java
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										21
									
								
								q2/cours6/Question.java
									
									
									
									
									
										Normal file
									
								
							@ -0,0 +1,21 @@
 | 
			
		||||
public class Question {
 | 
			
		||||
	private String text;
 | 
			
		||||
	private String response;
 | 
			
		||||
 | 
			
		||||
	private String user_input;
 | 
			
		||||
 | 
			
		||||
	public Question(text, response){
 | 
			
		||||
		this.text = text;
 | 
			
		||||
		this.response = response;
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	public void Poser(){
 | 
			
		||||
		Scanner resp = new Scanner(System.in);
 | 
			
		||||
		System.out.println(text + ": ")
 | 
			
		||||
		user_input = resp.nextLine();
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	public boolean Verifier(){
 | 
			
		||||
		return user_input == response;
 | 
			
		||||
	}
 | 
			
		||||
}
 | 
			
		||||
							
								
								
									
										18
									
								
								q2/cours6/Questionnaire.java
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										18
									
								
								q2/cours6/Questionnaire.java
									
									
									
									
									
										Normal file
									
								
							@ -0,0 +1,18 @@
 | 
			
		||||
public class Questionnaire {
 | 
			
		||||
	private Question[] questions;
 | 
			
		||||
 | 
			
		||||
	public void add_question;
 | 
			
		||||
 | 
			
		||||
	public void poser_tout(){
 | 
			
		||||
		for(Question q: questions){
 | 
			
		||||
			q.Poser();
 | 
			
		||||
			if(q.Verifier())
 | 
			
		||||
				System.out.println("Bravo");
 | 
			
		||||
			else
 | 
			
		||||
				System.out.println("Pas ouf");
 | 
			
		||||
 | 
			
		||||
		}
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
}
 | 
			
		||||
							
								
								
									
										4
									
								
								q2/cours6/TestsQuestionnaire.java
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										4
									
								
								q2/cours6/TestsQuestionnaire.java
									
									
									
									
									
										Normal file
									
								
							@ -0,0 +1,4 @@
 | 
			
		||||
public class TestsQuestionnaire {
 | 
			
		||||
	public static void main(String[] args) {
 | 
			
		||||
	}
 | 
			
		||||
}
 | 
			
		||||
							
								
								
									
										
											BIN
										
									
								
								q2/project/enonce.pdf
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										
											BIN
										
									
								
								q2/project/enonce.pdf
									
									
									
									
									
										Normal file
									
								
							
										
											Binary file not shown.
										
									
								
							
							
								
								
									
										18
									
								
								q2/tp1/Cercle.java
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										18
									
								
								q2/tp1/Cercle.java
									
									
									
									
									
										Normal file
									
								
							@ -0,0 +1,18 @@
 | 
			
		||||
public class Cercle {
 | 
			
		||||
	public static final double PI = 3.14159265;
 | 
			
		||||
 | 
			
		||||
	public static void main(String[] args) {
 | 
			
		||||
		for (int i = 1; i <= 50; i++) {
 | 
			
		||||
			System.out.println("pour un cercle de rayon : " + i + " Perimetre:" +  perimetre(i)+ " aire:" +  aire(i));
 | 
			
		||||
		}
 | 
			
		||||
		
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	public static double perimetre(double rayon){
 | 
			
		||||
		return 2*PI*rayon;
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	public static double aire(double rayon){
 | 
			
		||||
		return PI*rayon*rayon;
 | 
			
		||||
	}
 | 
			
		||||
}
 | 
			
		||||
							
								
								
									
										20
									
								
								q2/tp1/Droites.java
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										20
									
								
								q2/tp1/Droites.java
									
									
									
									
									
										Normal file
									
								
							@ -0,0 +1,20 @@
 | 
			
		||||
public class Droites {
 | 
			
		||||
	public static void main(String[] args) {
 | 
			
		||||
		droite(1, 1, 2, 2);
 | 
			
		||||
		if(appartient(-1,1, 0, 2, 2)){
 | 
			
		||||
			System.out.println("yay");
 | 
			
		||||
		}
 | 
			
		||||
		
 | 
			
		||||
	}
 | 
			
		||||
	public static void droite(double x1, double y1, double x2, double y2){
 | 
			
		||||
		double dir_x = x2 - x1, dir_y = y2 - y1;
 | 
			
		||||
		double a = -dir_y, b = dir_x;
 | 
			
		||||
		double c = a*x1 + b*y1;
 | 
			
		||||
		System.out.println("equation de la droite: " + a + "x + " + b + "y = " + c);
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	public static boolean appartient(double a, double b, double c, double x, double y){
 | 
			
		||||
		return a * x + b * y == c ;
 | 
			
		||||
 | 
			
		||||
	}
 | 
			
		||||
}
 | 
			
		||||
							
								
								
									
										18
									
								
								q2/tp1/HelloWorld.java
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										18
									
								
								q2/tp1/HelloWorld.java
									
									
									
									
									
										Normal file
									
								
							@ -0,0 +1,18 @@
 | 
			
		||||
public class HelloWorld {
 | 
			
		||||
	public static void main(String[] args) {
 | 
			
		||||
		String prenom = "Anthony";
 | 
			
		||||
		int age = 21;
 | 
			
		||||
		double taille = 1.85;
 | 
			
		||||
		printHello(prenom, age, taille);
 | 
			
		||||
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	public static void printHello(String prenom, int age, double taille)
 | 
			
		||||
	{
 | 
			
		||||
		System.out.println("Hello World");
 | 
			
		||||
		System.out.println("Mon nom est " + prenom);
 | 
			
		||||
		System.out.println("J'ai " + age + "ans et je mesure " + taille + "m :)");
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	
 | 
			
		||||
}
 | 
			
		||||
							
								
								
									
										32
									
								
								q2/tp1/Suite.java
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										32
									
								
								q2/tp1/Suite.java
									
									
									
									
									
										Normal file
									
								
							@ -0,0 +1,32 @@
 | 
			
		||||
public class Suite {
 | 
			
		||||
	public static void main(String[] args) {
 | 
			
		||||
		// suiteArithmetique(5, 5, 3);
 | 
			
		||||
		// suiteGeometrique(5, 5, 3);
 | 
			
		||||
		suiteFibonacci(15);
 | 
			
		||||
	
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	public static void suiteArithmetique(int depart, int raison, int k){
 | 
			
		||||
		for (int i = 0; i < k; i++) {
 | 
			
		||||
			System.out.println(depart + raison * i);
 | 
			
		||||
		}
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	public static void suiteGeometrique(int depart, int raison, int k){
 | 
			
		||||
		for (int i = 0; i < k; i++) {
 | 
			
		||||
			System.out.println(depart + (int)Math.pow(raison, i));
 | 
			
		||||
		}
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	public static void suiteFibonacci(int k){
 | 
			
		||||
		int el1 = 1;
 | 
			
		||||
		int el2 = 1;
 | 
			
		||||
		int temp;
 | 
			
		||||
		for (int i = 0; i < k-2; i++) {
 | 
			
		||||
			temp = el1;
 | 
			
		||||
			el1 = el2;
 | 
			
		||||
			el2 = temp + el2 ;
 | 
			
		||||
		}
 | 
			
		||||
		System.out.println(el2);
 | 
			
		||||
	}
 | 
			
		||||
}
 | 
			
		||||
							
								
								
									
										60
									
								
								q2/tp2/Droite.java
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										60
									
								
								q2/tp2/Droite.java
									
									
									
									
									
										Normal file
									
								
							@ -0,0 +1,60 @@
 | 
			
		||||
public class Droite {
 | 
			
		||||
	public double a, b, c;
 | 
			
		||||
 | 
			
		||||
	public String toString(){
 | 
			
		||||
		return a + "x + " + b + "y = " + c;
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	/*
 | 
			
		||||
	 * Represent a line in the space with the equation ax + by = c
 | 
			
		||||
	 * @param a ax
 | 
			
		||||
	 * @param b by
 | 
			
		||||
	 * @param c c
 | 
			
		||||
	 */
 | 
			
		||||
	Droite(double a, double b, double c){
 | 
			
		||||
		this.a = a;
 | 
			
		||||
		this.b = b;
 | 
			
		||||
		this.c = c;
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	/*
 | 
			
		||||
	 * Check if the line is horizontal
 | 
			
		||||
	 * @return true if the line is horizontal
 | 
			
		||||
	 * @return false if the line is not horizontal
 | 
			
		||||
	 */
 | 
			
		||||
	public boolean isHorizontal(){
 | 
			
		||||
		if(a == 0)
 | 
			
		||||
			return true;
 | 
			
		||||
		return false;
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	/*
 | 
			
		||||
	 * Find the intersection by 2 lines
 | 
			
		||||
	 * @param other the other line you should find the intersection with
 | 
			
		||||
	 * @return Point The Point of the intersection
 | 
			
		||||
	 * @return Null if the lines are not intersecting
 | 
			
		||||
	 * @return Null if the lines are the sames
 | 
			
		||||
	 */
 | 
			
		||||
	public Point intersection(Droite other){
 | 
			
		||||
		if(a * other.b - b * other.a == 0)
 | 
			
		||||
			return null;
 | 
			
		||||
		return new Point((other.b*c - b*other.c)/(a*other.b + b * other.a), (other.c - other.a*((other.b*c - b*other.c)/(a*other.b + b * other.a)))/other.b );
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	/*
 | 
			
		||||
	 * Create a new line with the two points given
 | 
			
		||||
	 * @param p1 the first point
 | 
			
		||||
	 * @param p2 the second point
 | 
			
		||||
	 * @return Droite the line that is between the given points
 | 
			
		||||
	 */
 | 
			
		||||
	public static Droite create(Point p1, Point p2){
 | 
			
		||||
		System.out.println(p1 + "; " + p2);
 | 
			
		||||
		Point directeur = new Point(p2.getX() - p1.getX(), p2.getY() - p2.getY());
 | 
			
		||||
		System.out.println(directeur);
 | 
			
		||||
		double a = -directeur.getY();
 | 
			
		||||
		double b = directeur.getX();
 | 
			
		||||
		return new Droite(a, b, a*p1.getX() + b*p1.getY());
 | 
			
		||||
	}
 | 
			
		||||
}
 | 
			
		||||
							
								
								
									
										33
									
								
								q2/tp2/DroiteTest.java
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										33
									
								
								q2/tp2/DroiteTest.java
									
									
									
									
									
										Normal file
									
								
							@ -0,0 +1,33 @@
 | 
			
		||||
public class DroiteTest {
 | 
			
		||||
	public static void main(String[] args) {
 | 
			
		||||
		Point p1 = new Point(1, 1);
 | 
			
		||||
		Point p2 = new Point(5, 3);
 | 
			
		||||
		Point p3 = new Point(0, 4);
 | 
			
		||||
		Point p4 = new Point(4, 6);
 | 
			
		||||
 | 
			
		||||
		Droite d1 = new Droite(0, 1, 2);
 | 
			
		||||
		System.out.println(d1);
 | 
			
		||||
 | 
			
		||||
		Droite d2 = Droite.create(p1, p2);
 | 
			
		||||
		Droite d3 = Droite.create(p3, p4);
 | 
			
		||||
		System.out.println(d2);
 | 
			
		||||
		System.out.println(d3);
 | 
			
		||||
 | 
			
		||||
		if(d2.isHorizontal())
 | 
			
		||||
			System.out.println("d2 is horizontal");
 | 
			
		||||
		if(d3.isHorizontal())
 | 
			
		||||
			System.out.println("d3 is horizontal");
 | 
			
		||||
		
 | 
			
		||||
		Point int1 = d1.intersection(d2);
 | 
			
		||||
		if(int1 == null)
 | 
			
		||||
			System.out.println("d1 et d2 sont paralleles ou confondues");
 | 
			
		||||
 | 
			
		||||
		Point int2 = d1.intersection(d3);
 | 
			
		||||
		if(int2 == null)
 | 
			
		||||
			System.out.println("d1 et d3 sont paralleles ou confondues");
 | 
			
		||||
 | 
			
		||||
		Point int3 = d2.intersection(d3);
 | 
			
		||||
		if(int3 == null)
 | 
			
		||||
			System.out.println("d2 et d3 sont paralleles ou confondues");
 | 
			
		||||
	}
 | 
			
		||||
}
 | 
			
		||||
							
								
								
									
										26
									
								
								q2/tp2/Point.java
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										26
									
								
								q2/tp2/Point.java
									
									
									
									
									
										Normal file
									
								
							@ -0,0 +1,26 @@
 | 
			
		||||
public class Point {
 | 
			
		||||
	private double x, y;
 | 
			
		||||
 | 
			
		||||
	public String toString(){
 | 
			
		||||
		return "("+ x+ ":" + y + ")";
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	Point(){
 | 
			
		||||
		x = 0;
 | 
			
		||||
		y = 0;
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	Point(double x, double y){
 | 
			
		||||
		this.x = x;
 | 
			
		||||
		this.y = y;
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	public double getX() {
 | 
			
		||||
		return x;
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	public double getY() {
 | 
			
		||||
		return y;
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
}
 | 
			
		||||
							
								
								
									
										
											BIN
										
									
								
								q2/tp2/TP2.pdf
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										
											BIN
										
									
								
								q2/tp2/TP2.pdf
									
									
									
									
									
										Normal file
									
								
							
										
											Binary file not shown.
										
									
								
							
							
								
								
									
										
											BIN
										
									
								
								q2/tp2/hanoi.zip
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										
											BIN
										
									
								
								q2/tp2/hanoi.zip
									
									
									
									
									
										Normal file
									
								
							
										
											Binary file not shown.
										
									
								
							
							
								
								
									
										112
									
								
								q2/tp2/hanoi/src/tours_hanoi/HanoiFrame.java
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										112
									
								
								q2/tp2/hanoi/src/tours_hanoi/HanoiFrame.java
									
									
									
									
									
										Normal file
									
								
							@ -0,0 +1,112 @@
 | 
			
		||||
package tours_hanoi;
 | 
			
		||||
 | 
			
		||||
import java.awt.BorderLayout;
 | 
			
		||||
import java.awt.Color;
 | 
			
		||||
import java.awt.Dimension;
 | 
			
		||||
import java.awt.FlowLayout;
 | 
			
		||||
import java.awt.Graphics;
 | 
			
		||||
import java.awt.Toolkit;
 | 
			
		||||
 | 
			
		||||
import javax.swing.JFrame;
 | 
			
		||||
import javax.swing.JLabel;
 | 
			
		||||
import javax.swing.JPanel;
 | 
			
		||||
 | 
			
		||||
public class HanoiFrame extends JFrame implements HanoiState.Listener {
 | 
			
		||||
 | 
			
		||||
    private final HanoiState state;
 | 
			
		||||
    private final int delay;
 | 
			
		||||
 | 
			
		||||
    public static final int MARGIN_X = 10;
 | 
			
		||||
    public static final int MARGIN_Y = 10;
 | 
			
		||||
    public static final int TOWER_W = 10; // Largeur d'une tour
 | 
			
		||||
    public static final int DISK_H = 30; // Hauteur d'un disque
 | 
			
		||||
 | 
			
		||||
    public static final Color DISK_COLOR = Color.BLUE;
 | 
			
		||||
 | 
			
		||||
    private class HanoiPanel extends JPanel {
 | 
			
		||||
 | 
			
		||||
        /** Dessine la tour d'index i
 | 
			
		||||
         *
 | 
			
		||||
         * @param g contexte graphique
 | 
			
		||||
         * @param i index de la tour (0 <= i < NUM_TOWERS)
 | 
			
		||||
         */
 | 
			
		||||
        private void drawTower(Graphics g, int i) {
 | 
			
		||||
            int w = getWidth();
 | 
			
		||||
            int h = getHeight();
 | 
			
		||||
            int tw = (w - (2 + HanoiState.NUM_TOWERS - 1) * MARGIN_X) / HanoiState.NUM_TOWERS; // largeur espace tour
 | 
			
		||||
            g.fillRect(MARGIN_X + tw / 2 + i * tw - TOWER_W / 2, MARGIN_Y, TOWER_W, h - 2 * MARGIN_Y);
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        /** Dessine un disque de taille size sur la tour i en hauteur j
 | 
			
		||||
         *
 | 
			
		||||
         * @param g contexte graphique
 | 
			
		||||
         * @param i index de la tour (0 <= i < NUM_TOWERS)
 | 
			
		||||
         * @param j hauteur du disque (0 <= j)
 | 
			
		||||
         * @param size taille du disque (0 <= size < MAX_DISKS)
 | 
			
		||||
         */
 | 
			
		||||
        private void drawDisk(Graphics g, int i, int j, int size) {
 | 
			
		||||
            int w = getWidth();
 | 
			
		||||
            int h = getHeight();
 | 
			
		||||
            int tw = (w - (2 + HanoiState.NUM_TOWERS - 1) * MARGIN_X) / HanoiState.NUM_TOWERS; // largeur espace tour
 | 
			
		||||
            int x = MARGIN_X + tw / 2 + i * tw;
 | 
			
		||||
            int y = h - MARGIN_Y - (j + 1) * DISK_H;
 | 
			
		||||
            int pw = TOWER_W + (int) (1.0 * (tw - TOWER_W) * (size + 1) / HanoiState.MAX_DISKS);
 | 
			
		||||
 | 
			
		||||
            g.setColor(DISK_COLOR);
 | 
			
		||||
            g.fillRect(x - pw / 2, y, pw, DISK_H);
 | 
			
		||||
            g.setColor(Color.BLACK);
 | 
			
		||||
            g.drawRect(x - pw / 2, y, pw, DISK_H);
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        /** Dessine les tours et disques sur base de l'état du jeu */
 | 
			
		||||
        @Override
 | 
			
		||||
        public void paintComponent(Graphics g) {
 | 
			
		||||
            for (int i = 0; i < HanoiState.NUM_TOWERS; i++) {
 | 
			
		||||
                drawTower(g, i);
 | 
			
		||||
                for (int j = 0; j < state.getNumDisks(i); j++)
 | 
			
		||||
                    drawDisk(g, i, j, state.getDiskSize(i, j));
 | 
			
		||||
            }
 | 
			
		||||
        }
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    private JLabel labelCountMoves;
 | 
			
		||||
 | 
			
		||||
    /** Crée une instance de fenêtre représentant l'état du jeu
 | 
			
		||||
     *
 | 
			
		||||
     * @param state état du jeu
 | 
			
		||||
     * @param delay délai en millisecondes attendu après chaque mise à jour
 | 
			
		||||
     */
 | 
			
		||||
    public HanoiFrame(HanoiState state, int delay) {
 | 
			
		||||
        super("Tours de Hanoï");
 | 
			
		||||
        this.state = state;
 | 
			
		||||
        this.delay = delay;
 | 
			
		||||
 | 
			
		||||
        state.addListener(this);
 | 
			
		||||
 | 
			
		||||
        JPanel outerPanel = new JPanel(new BorderLayout());
 | 
			
		||||
        add(outerPanel);
 | 
			
		||||
        JPanel topPanel = new JPanel(new FlowLayout());
 | 
			
		||||
        labelCountMoves = new JLabel("0 déplacements");
 | 
			
		||||
        topPanel.add(labelCountMoves);
 | 
			
		||||
        outerPanel.add(new HanoiPanel(), BorderLayout.CENTER);
 | 
			
		||||
        outerPanel.add(topPanel, BorderLayout.NORTH);
 | 
			
		||||
        Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize();
 | 
			
		||||
        setSize(screenSize);
 | 
			
		||||
        setVisible(true);
 | 
			
		||||
        setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /** Met à jour la représentation graphique du jeu */
 | 
			
		||||
    @Override
 | 
			
		||||
    public void stateChanged() {
 | 
			
		||||
        int mc = state.getMovesCount();
 | 
			
		||||
        labelCountMoves.setText(mc + " déplacement" + (mc > 1 ? "s" : ""));
 | 
			
		||||
        repaint();
 | 
			
		||||
        try {
 | 
			
		||||
            Thread.sleep(delay);
 | 
			
		||||
        } catch (InterruptedException e) {
 | 
			
		||||
            // TODO Auto-generated catch block
 | 
			
		||||
            e.printStackTrace();
 | 
			
		||||
        }
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
							
								
								
									
										453
									
								
								q2/tp2/hanoi/src/tours_hanoi/HanoiState.html
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										453
									
								
								q2/tp2/hanoi/src/tours_hanoi/HanoiState.html
									
									
									
									
									
										Normal file
									
								
							@ -0,0 +1,453 @@
 | 
			
		||||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
 | 
			
		||||
<!-- NewPage -->
 | 
			
		||||
<html lang="fr">
 | 
			
		||||
    <head>
 | 
			
		||||
        <!-- Generated by javadoc (1.8.0_144) on Tue Feb 20 13:30:33 CET 2018 -->
 | 
			
		||||
        <title>HanoiState</title>
 | 
			
		||||
        <meta name="date" content="2018-02-20">
 | 
			
		||||
        <link rel="stylesheet" type="text/css" href="stylesheet.css" title="Style">
 | 
			
		||||
        <script type="text/javascript" src="../script.js"></script>
 | 
			
		||||
    </head>
 | 
			
		||||
    <body>
 | 
			
		||||
        <script type="text/javascript"><!--
 | 
			
		||||
            try {
 | 
			
		||||
        if (location.href.indexOf('is-external=true') == -1) {
 | 
			
		||||
            parent.document.title="HanoiState";
 | 
			
		||||
        }
 | 
			
		||||
    }
 | 
			
		||||
    catch(err) {
 | 
			
		||||
    }
 | 
			
		||||
//-->
 | 
			
		||||
var methods = {"i0":10,"i1":10,"i2":10,"i3":10,"i4":10};
 | 
			
		||||
var tabs = {65535:["t0","All Methods"],2:["t2","Instance Methods"],8:["t4","Concrete Methods"]};
 | 
			
		||||
var altColor = "altColor";
 | 
			
		||||
var rowColor = "rowColor";
 | 
			
		||||
var tableTab = "tableTab";
 | 
			
		||||
var activeTableTab = "activeTableTab";
 | 
			
		||||
        </script>
 | 
			
		||||
        <noscript>
 | 
			
		||||
            <div>JavaScript is disabled on your browser.</div>
 | 
			
		||||
        </noscript>
 | 
			
		||||
        <!-- ========= START OF TOP NAVBAR ======= -->
 | 
			
		||||
        <div class="topNav"><a name="navbar.top">
 | 
			
		||||
                <!--   -->
 | 
			
		||||
            </a>
 | 
			
		||||
            <div class="skipNav"><a href="#skip.navbar.top" title="Skip navigation links">Skip navigation links</a></div>
 | 
			
		||||
            <a name="navbar.top.firstrow">
 | 
			
		||||
                <!--   -->
 | 
			
		||||
            </a>
 | 
			
		||||
            <ul class="navList" title="Navigation">
 | 
			
		||||
                <li><a href="../tours_hanoi/package-summary.html">Package</a></li>
 | 
			
		||||
                <li class="navBarCell1Rev">Class</li>
 | 
			
		||||
                <li><a href="package-tree.html">Tree</a></li>
 | 
			
		||||
                <li><a href="../deprecated-list.html">Deprecated</a></li>
 | 
			
		||||
                <li><a href="../index-all.html">Index</a></li>
 | 
			
		||||
                <li><a href="../help-doc.html">Help</a></li>
 | 
			
		||||
            </ul>
 | 
			
		||||
        </div>
 | 
			
		||||
        <div class="subNav">
 | 
			
		||||
            <ul class="navList">
 | 
			
		||||
                <li>Prev Class</li>
 | 
			
		||||
                <li><a href="../tours_hanoi/HanoiState.Listener.html" title="interface in tours_hanoi"><span class="typeNameLink">Next Class</span></a></li>
 | 
			
		||||
            </ul>
 | 
			
		||||
            <ul class="navList">
 | 
			
		||||
                <li><a href="../index.html?tours_hanoi/HanoiState.html" target="_top">Frames</a></li>
 | 
			
		||||
                <li><a href="HanoiState.html" target="_top">No Frames</a></li>
 | 
			
		||||
            </ul>
 | 
			
		||||
            <ul class="navList" id="allclasses_navbar_top">
 | 
			
		||||
                <li><a href="../allclasses-noframe.html">All Classes</a></li>
 | 
			
		||||
            </ul>
 | 
			
		||||
            <div>
 | 
			
		||||
                <script type="text/javascript"><!--
 | 
			
		||||
                    allClassesLink = document.getElementById("allclasses_navbar_top");
 | 
			
		||||
  if(window==top) {
 | 
			
		||||
    allClassesLink.style.display = "block";
 | 
			
		||||
  }
 | 
			
		||||
  else {
 | 
			
		||||
    allClassesLink.style.display = "none";
 | 
			
		||||
  }
 | 
			
		||||
//-->
 | 
			
		||||
                </script>
 | 
			
		||||
            </div>
 | 
			
		||||
            <div>
 | 
			
		||||
                <ul class="subNavList">
 | 
			
		||||
                    <li>Summary: </li>
 | 
			
		||||
                    <li><a href="#nested.class.summary">Nested</a> | </li>
 | 
			
		||||
                    <li><a href="#field.summary">Field</a> | </li>
 | 
			
		||||
                    <li><a href="#constructor.summary">Constr</a> | </li>
 | 
			
		||||
                    <li><a href="#method.summary">Method</a></li>
 | 
			
		||||
                </ul>
 | 
			
		||||
                <ul class="subNavList">
 | 
			
		||||
                    <li>Detail: </li>
 | 
			
		||||
                    <li><a href="#field.detail">Field</a> | </li>
 | 
			
		||||
                    <li><a href="#constructor.detail">Constr</a> | </li>
 | 
			
		||||
                    <li><a href="#method.detail">Method</a></li>
 | 
			
		||||
                </ul>
 | 
			
		||||
            </div>
 | 
			
		||||
            <a name="skip.navbar.top">
 | 
			
		||||
                <!--   -->
 | 
			
		||||
            </a></div>
 | 
			
		||||
            <!-- ========= END OF TOP NAVBAR ========= -->
 | 
			
		||||
            <!-- ======== START OF CLASS DATA ======== -->
 | 
			
		||||
            <div class="header">
 | 
			
		||||
                <div class="subTitle">tours_hanoi</div>
 | 
			
		||||
                <h2 title="Class HanoiState" class="title">Class HanoiState</h2>
 | 
			
		||||
            </div>
 | 
			
		||||
            <div class="contentContainer">
 | 
			
		||||
                <ul class="inheritance">
 | 
			
		||||
                    <li>java.lang.Object</li>
 | 
			
		||||
                    <li>
 | 
			
		||||
                        <ul class="inheritance">
 | 
			
		||||
                            <li>tours_hanoi.HanoiState</li>
 | 
			
		||||
                        </ul>
 | 
			
		||||
                    </li>
 | 
			
		||||
                </ul>
 | 
			
		||||
                <div class="description">
 | 
			
		||||
                    <ul class="blockList">
 | 
			
		||||
                        <li class="blockList">
 | 
			
		||||
                            <hr>
 | 
			
		||||
                            <br>
 | 
			
		||||
                            <pre>public class <span class="typeNameLabel">HanoiState</span>
 | 
			
		||||
extends java.lang.Object</pre>
 | 
			
		||||
                        </li>
 | 
			
		||||
                    </ul>
 | 
			
		||||
                </div>
 | 
			
		||||
                <div class="summary">
 | 
			
		||||
                    <ul class="blockList">
 | 
			
		||||
                        <li class="blockList">
 | 
			
		||||
                            <!-- ======== NESTED CLASS SUMMARY ======== -->
 | 
			
		||||
                            <ul class="blockList">
 | 
			
		||||
                                <li class="blockList"><a name="nested.class.summary">
 | 
			
		||||
                                        <!--   -->
 | 
			
		||||
                                    </a>
 | 
			
		||||
                                    <h3>Nested Class Summary</h3>
 | 
			
		||||
                                    <table class="memberSummary" border="0" cellpadding="3" cellspacing="0" summary="Nested Class Summary table, listing nested classes, and an explanation">
 | 
			
		||||
                                        <caption><span>Nested Classes</span><span class="tabEnd"> </span></caption>
 | 
			
		||||
                                        <tr>
 | 
			
		||||
                                            <th class="colFirst" scope="col">Modifier and Type</th>
 | 
			
		||||
                                            <th class="colLast" scope="col">Class and Description</th>
 | 
			
		||||
                                        </tr>
 | 
			
		||||
                                        <tr class="altColor">
 | 
			
		||||
                                            <td class="colFirst"><code>static interface </code></td>
 | 
			
		||||
                                            <td class="colLast"><code><span class="memberNameLink"><a href="../tours_hanoi/HanoiState.Listener.html" title="interface in tours_hanoi">HanoiState.Listener</a></span></code>
 | 
			
		||||
                                                <div class="block">Permet d'<27>tre notifi<66> des changements d'<27>tats
 | 
			
		||||
                                                    (utilis<69> p.ex. par la fen<65>tre d'affichage)</div>
 | 
			
		||||
                                            </td>
 | 
			
		||||
                                        </tr>
 | 
			
		||||
                                    </table>
 | 
			
		||||
                                </li>
 | 
			
		||||
                            </ul>
 | 
			
		||||
                            <!-- =========== FIELD SUMMARY =========== -->
 | 
			
		||||
                            <ul class="blockList">
 | 
			
		||||
                                <li class="blockList"><a name="field.summary">
 | 
			
		||||
                                        <!--   -->
 | 
			
		||||
                                    </a>
 | 
			
		||||
                                    <h3>Field Summary</h3>
 | 
			
		||||
                                    <table class="memberSummary" border="0" cellpadding="3" cellspacing="0" summary="Field Summary table, listing fields, and an explanation">
 | 
			
		||||
                                        <caption><span>Fields</span><span class="tabEnd"> </span></caption>
 | 
			
		||||
                                        <tr>
 | 
			
		||||
                                            <th class="colFirst" scope="col">Modifier and Type</th>
 | 
			
		||||
                                            <th class="colLast" scope="col">Field and Description</th>
 | 
			
		||||
                                        </tr>
 | 
			
		||||
                                        <tr class="altColor">
 | 
			
		||||
                                            <td class="colFirst"><code>static int</code></td>
 | 
			
		||||
                                            <td class="colLast"><code><span class="memberNameLink"><a href="../tours_hanoi/HanoiState.html#MAX_DISKS">MAX_DISKS</a></span></code>
 | 
			
		||||
                                                <div class="block">Nombre max. de pi<70>ces</div>
 | 
			
		||||
                                            </td>
 | 
			
		||||
                                        </tr>
 | 
			
		||||
                                        <tr class="rowColor">
 | 
			
		||||
                                            <td class="colFirst"><code>static int</code></td>
 | 
			
		||||
                                            <td class="colLast"><code><span class="memberNameLink"><a href="../tours_hanoi/HanoiState.html#NUM_TOWERS">NUM_TOWERS</a></span></code>
 | 
			
		||||
                                                <div class="block">Nombre de tours</div>
 | 
			
		||||
                                            </td>
 | 
			
		||||
                                        </tr>
 | 
			
		||||
                                    </table>
 | 
			
		||||
                                </li>
 | 
			
		||||
                            </ul>
 | 
			
		||||
                            <!-- ======== CONSTRUCTOR SUMMARY ======== -->
 | 
			
		||||
                            <ul class="blockList">
 | 
			
		||||
                                <li class="blockList"><a name="constructor.summary">
 | 
			
		||||
                                        <!--   -->
 | 
			
		||||
                                    </a>
 | 
			
		||||
                                    <h3>Constructor Summary</h3>
 | 
			
		||||
                                    <table class="memberSummary" border="0" cellpadding="3" cellspacing="0" summary="Constructor Summary table, listing constructors, and an explanation">
 | 
			
		||||
                                        <caption><span>Constructors</span><span class="tabEnd"> </span></caption>
 | 
			
		||||
                                        <tr>
 | 
			
		||||
                                            <th class="colOne" scope="col">Constructor and Description</th>
 | 
			
		||||
                                        </tr>
 | 
			
		||||
                                        <tr class="altColor">
 | 
			
		||||
                                            <td class="colOne"><code><span class="memberNameLink"><a href="../tours_hanoi/HanoiState.html#HanoiState-int-">HanoiState</a></span>(int n)</code>
 | 
			
		||||
                                                <div class="block">Construit un jeu des Tours de Hano<6E> <20> n disques</div>
 | 
			
		||||
                                            </td>
 | 
			
		||||
                                        </tr>
 | 
			
		||||
                                    </table>
 | 
			
		||||
                                </li>
 | 
			
		||||
                            </ul>
 | 
			
		||||
                            <!-- ========== METHOD SUMMARY =========== -->
 | 
			
		||||
                            <ul class="blockList">
 | 
			
		||||
                                <li class="blockList"><a name="method.summary">
 | 
			
		||||
                                        <!--   -->
 | 
			
		||||
                                    </a>
 | 
			
		||||
                                    <h3>Method Summary</h3>
 | 
			
		||||
                                    <table class="memberSummary" border="0" cellpadding="3" cellspacing="0" summary="Method Summary table, listing methods, and an explanation">
 | 
			
		||||
                                        <caption><span id="t0" class="activeTableTab"><span>All Methods</span><span class="tabEnd"> </span></span><span id="t2" class="tableTab"><span><a href="javascript:show(2);">Instance Methods</a></span><span class="tabEnd"> </span></span><span id="t4" class="tableTab"><span><a href="javascript:show(8);">Concrete Methods</a></span><span class="tabEnd"> </span></span></caption>
 | 
			
		||||
                                        <tr>
 | 
			
		||||
                                            <th class="colFirst" scope="col">Modifier and Type</th>
 | 
			
		||||
                                            <th class="colLast" scope="col">Method and Description</th>
 | 
			
		||||
                                        </tr>
 | 
			
		||||
                                        <tr id="i0" class="altColor">
 | 
			
		||||
                                            <td class="colFirst"><code>void</code></td>
 | 
			
		||||
                                            <td class="colLast"><code><span class="memberNameLink"><a href="../tours_hanoi/HanoiState.html#addListener-tours_hanoi.HanoiState.Listener-">addListener</a></span>(<a href="../tours_hanoi/HanoiState.Listener.html" title="interface in tours_hanoi">HanoiState.Listener</a> l)</code>
 | 
			
		||||
                                                <div class="block">Enregistre un listener suppl<70>mentaire</div>
 | 
			
		||||
                                            </td>
 | 
			
		||||
                                        </tr>
 | 
			
		||||
                                        <tr id="i1" class="rowColor">
 | 
			
		||||
                                            <td class="colFirst"><code>int</code></td>
 | 
			
		||||
                                            <td class="colLast"><code><span class="memberNameLink"><a href="../tours_hanoi/HanoiState.html#getDiskSize-int-int-">getDiskSize</a></span>(int tower,
 | 
			
		||||
                                                    int j)</code>
 | 
			
		||||
                                                <div class="block">Retourne la taille de la pi<70>ce en position j de la tour i</div>
 | 
			
		||||
                                            </td>
 | 
			
		||||
                                        </tr>
 | 
			
		||||
                                        <tr id="i2" class="altColor">
 | 
			
		||||
                                            <td class="colFirst"><code>int</code></td>
 | 
			
		||||
                                            <td class="colLast"><code><span class="memberNameLink"><a href="../tours_hanoi/HanoiState.html#getMovesCount--">getMovesCount</a></span>()</code>
 | 
			
		||||
                                                <div class="block">Retourne le nombre total de d<>placements</div>
 | 
			
		||||
                                            </td>
 | 
			
		||||
                                        </tr>
 | 
			
		||||
                                        <tr id="i3" class="rowColor">
 | 
			
		||||
                                            <td class="colFirst"><code>int</code></td>
 | 
			
		||||
                                            <td class="colLast"><code><span class="memberNameLink"><a href="../tours_hanoi/HanoiState.html#getNumDisks-int-">getNumDisks</a></span>(int tower)</code>
 | 
			
		||||
                                                <div class="block">Retourne le nombre de pi<70>ces sur la tour i</div>
 | 
			
		||||
                                            </td>
 | 
			
		||||
                                        </tr>
 | 
			
		||||
                                        <tr id="i4" class="altColor">
 | 
			
		||||
                                            <td class="colFirst"><code>void</code></td>
 | 
			
		||||
                                            <td class="colLast"><code><span class="memberNameLink"><a href="../tours_hanoi/HanoiState.html#move-int-int-">move</a></span>(int from,
 | 
			
		||||
                                                    int to)</code>
 | 
			
		||||
                                                <div class="block">D<EFBFBD>place une pi<70>ce du sommet d'une tour au sommet d'une autre tour.</div>
 | 
			
		||||
                                            </td>
 | 
			
		||||
                                        </tr>
 | 
			
		||||
                                    </table>
 | 
			
		||||
                                    <ul class="blockList">
 | 
			
		||||
                                        <li class="blockList"><a name="methods.inherited.from.class.java.lang.Object">
 | 
			
		||||
                                                <!--   -->
 | 
			
		||||
                                            </a>
 | 
			
		||||
                                            <h3>Methods inherited from class java.lang.Object</h3>
 | 
			
		||||
                                            <code>clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait</code></li>
 | 
			
		||||
                                    </ul>
 | 
			
		||||
                                </li>
 | 
			
		||||
                            </ul>
 | 
			
		||||
                        </li>
 | 
			
		||||
                    </ul>
 | 
			
		||||
                </div>
 | 
			
		||||
                <div class="details">
 | 
			
		||||
                    <ul class="blockList">
 | 
			
		||||
                        <li class="blockList">
 | 
			
		||||
                            <!-- ============ FIELD DETAIL =========== -->
 | 
			
		||||
                            <ul class="blockList">
 | 
			
		||||
                                <li class="blockList"><a name="field.detail">
 | 
			
		||||
                                        <!--   -->
 | 
			
		||||
                                    </a>
 | 
			
		||||
                                    <h3>Field Detail</h3>
 | 
			
		||||
                                    <a name="NUM_TOWERS">
 | 
			
		||||
                                        <!--   -->
 | 
			
		||||
                                    </a>
 | 
			
		||||
                                    <ul class="blockList">
 | 
			
		||||
                                        <li class="blockList">
 | 
			
		||||
                                            <h4>NUM_TOWERS</h4>
 | 
			
		||||
                                            <pre>public static final int NUM_TOWERS</pre>
 | 
			
		||||
                                            <div class="block">Nombre de tours</div>
 | 
			
		||||
                                            <dl>
 | 
			
		||||
                                                <dt><span class="seeLabel">See Also:</span></dt>
 | 
			
		||||
                                                <dd><a href="../constant-values.html#tours_hanoi.HanoiState.NUM_TOWERS">Constant Field Values</a></dd>
 | 
			
		||||
                                            </dl>
 | 
			
		||||
                                        </li>
 | 
			
		||||
                                    </ul>
 | 
			
		||||
                                    <a name="MAX_DISKS">
 | 
			
		||||
                                        <!--   -->
 | 
			
		||||
                                    </a>
 | 
			
		||||
                                    <ul class="blockListLast">
 | 
			
		||||
                                        <li class="blockList">
 | 
			
		||||
                                            <h4>MAX_DISKS</h4>
 | 
			
		||||
                                            <pre>public static final int MAX_DISKS</pre>
 | 
			
		||||
                                            <div class="block">Nombre max. de pi<70>ces</div>
 | 
			
		||||
                                            <dl>
 | 
			
		||||
                                                <dt><span class="seeLabel">See Also:</span></dt>
 | 
			
		||||
                                                <dd><a href="../constant-values.html#tours_hanoi.HanoiState.MAX_DISKS">Constant Field Values</a></dd>
 | 
			
		||||
                                            </dl>
 | 
			
		||||
                                        </li>
 | 
			
		||||
                                    </ul>
 | 
			
		||||
                                </li>
 | 
			
		||||
                            </ul>
 | 
			
		||||
                            <!-- ========= CONSTRUCTOR DETAIL ======== -->
 | 
			
		||||
                            <ul class="blockList">
 | 
			
		||||
                                <li class="blockList"><a name="constructor.detail">
 | 
			
		||||
                                        <!--   -->
 | 
			
		||||
                                    </a>
 | 
			
		||||
                                    <h3>Constructor Detail</h3>
 | 
			
		||||
                                    <a name="HanoiState-int-">
 | 
			
		||||
                                        <!--   -->
 | 
			
		||||
                                    </a>
 | 
			
		||||
                                    <ul class="blockListLast">
 | 
			
		||||
                                        <li class="blockList">
 | 
			
		||||
                                            <h4>HanoiState</h4>
 | 
			
		||||
                                            <pre>public HanoiState(int n)</pre>
 | 
			
		||||
                                            <div class="block">Construit un jeu des Tours de Hano<6E> <20> n disques</div>
 | 
			
		||||
                                            <dl>
 | 
			
		||||
                                                <dt><span class="paramLabel">Parameters:</span></dt>
 | 
			
		||||
                                                <dd><code>n</code> - Le nombre de disques</dd>
 | 
			
		||||
                                            </dl>
 | 
			
		||||
                                        </li>
 | 
			
		||||
                                    </ul>
 | 
			
		||||
                                </li>
 | 
			
		||||
                            </ul>
 | 
			
		||||
                            <!-- ============ METHOD DETAIL ========== -->
 | 
			
		||||
                            <ul class="blockList">
 | 
			
		||||
                                <li class="blockList"><a name="method.detail">
 | 
			
		||||
                                        <!--   -->
 | 
			
		||||
                                    </a>
 | 
			
		||||
                                    <h3>Method Detail</h3>
 | 
			
		||||
                                    <a name="move-int-int-">
 | 
			
		||||
                                        <!--   -->
 | 
			
		||||
                                    </a>
 | 
			
		||||
                                    <ul class="blockList">
 | 
			
		||||
                                        <li class="blockList">
 | 
			
		||||
                                            <h4>move</h4>
 | 
			
		||||
                                            <pre>public void move(int from,
 | 
			
		||||
                 int to)</pre>
 | 
			
		||||
                                            <div class="block">D<EFBFBD>place une pi<70>ce du sommet d'une tour au sommet d'une autre tour.
 | 
			
		||||
                                                V<>rifie que les contraintes du jeu sont respect<63>es.</div>
 | 
			
		||||
                                            <dl>
 | 
			
		||||
                                                <dt><span class="paramLabel">Parameters:</span></dt>
 | 
			
		||||
                                                <dd><code>from</code> - Indice de la tours de d<>part</dd>
 | 
			
		||||
                                                <dd><code>to</code> - Indice de la tour d'arriv<69>e</dd>
 | 
			
		||||
                                            </dl>
 | 
			
		||||
                                        </li>
 | 
			
		||||
                                    </ul>
 | 
			
		||||
                                    <a name="getNumDisks-int-">
 | 
			
		||||
                                        <!--   -->
 | 
			
		||||
                                    </a>
 | 
			
		||||
                                    <ul class="blockList">
 | 
			
		||||
                                        <li class="blockList">
 | 
			
		||||
                                            <h4>getNumDisks</h4>
 | 
			
		||||
                                            <pre>public int getNumDisks(int tower)</pre>
 | 
			
		||||
                                            <div class="block">Retourne le nombre de pi<70>ces sur la tour i</div>
 | 
			
		||||
                                            <dl>
 | 
			
		||||
                                                <dt><span class="paramLabel">Parameters:</span></dt>
 | 
			
		||||
                                                <dd><code>tower</code> - L'indice de la tour</dd>
 | 
			
		||||
                                                <dt><span class="returnLabel">Returns:</span></dt>
 | 
			
		||||
                                                <dd>Le nombre de pi<70>ces sur la tour</dd>
 | 
			
		||||
                                            </dl>
 | 
			
		||||
                                        </li>
 | 
			
		||||
                                    </ul>
 | 
			
		||||
                                    <a name="getDiskSize-int-int-">
 | 
			
		||||
                                        <!--   -->
 | 
			
		||||
                                    </a>
 | 
			
		||||
                                    <ul class="blockList">
 | 
			
		||||
                                        <li class="blockList">
 | 
			
		||||
                                            <h4>getDiskSize</h4>
 | 
			
		||||
                                            <pre>public int getDiskSize(int tower,
 | 
			
		||||
                       int j)</pre>
 | 
			
		||||
                                            <div class="block">Retourne la taille de la pi<70>ce en position j de la tour i</div>
 | 
			
		||||
                                            <dl>
 | 
			
		||||
                                                <dt><span class="paramLabel">Parameters:</span></dt>
 | 
			
		||||
                                                <dd><code>tower</code> - L'indice de la tour</dd>
 | 
			
		||||
                                                <dd><code>j</code> - La position de la pi<70>ce</dd>
 | 
			
		||||
                                                <dt><span class="returnLabel">Returns:</span></dt>
 | 
			
		||||
                                                <dd>La taille de la pi<70>ce en position j dans la tour</dd>
 | 
			
		||||
                                            </dl>
 | 
			
		||||
                                        </li>
 | 
			
		||||
                                    </ul>
 | 
			
		||||
                                    <a name="getMovesCount--">
 | 
			
		||||
                                        <!--   -->
 | 
			
		||||
                                    </a>
 | 
			
		||||
                                    <ul class="blockList">
 | 
			
		||||
                                        <li class="blockList">
 | 
			
		||||
                                            <h4>getMovesCount</h4>
 | 
			
		||||
                                            <pre>public int getMovesCount()</pre>
 | 
			
		||||
                                            <div class="block">Retourne le nombre total de d<>placements</div>
 | 
			
		||||
                                            <dl>
 | 
			
		||||
                                                <dt><span class="returnLabel">Returns:</span></dt>
 | 
			
		||||
                                                <dd>Le nombre total de d<>placements</dd>
 | 
			
		||||
                                            </dl>
 | 
			
		||||
                                        </li>
 | 
			
		||||
                                    </ul>
 | 
			
		||||
                                    <a name="addListener-tours_hanoi.HanoiState.Listener-">
 | 
			
		||||
                                        <!--   -->
 | 
			
		||||
                                    </a>
 | 
			
		||||
                                    <ul class="blockListLast">
 | 
			
		||||
                                        <li class="blockList">
 | 
			
		||||
                                            <h4>addListener</h4>
 | 
			
		||||
                                            <pre>public void addListener(<a href="../tours_hanoi/HanoiState.Listener.html" title="interface in tours_hanoi">HanoiState.Listener</a> l)</pre>
 | 
			
		||||
                                            <div class="block">Enregistre un listener suppl<70>mentaire</div>
 | 
			
		||||
                                        </li>
 | 
			
		||||
                                    </ul>
 | 
			
		||||
                                </li>
 | 
			
		||||
                            </ul>
 | 
			
		||||
                        </li>
 | 
			
		||||
                    </ul>
 | 
			
		||||
                </div>
 | 
			
		||||
            </div>
 | 
			
		||||
            <!-- ========= END OF CLASS DATA ========= -->
 | 
			
		||||
            <!-- ======= START OF BOTTOM NAVBAR ====== -->
 | 
			
		||||
            <div class="bottomNav"><a name="navbar.bottom">
 | 
			
		||||
                    <!--   -->
 | 
			
		||||
                </a>
 | 
			
		||||
                <div class="skipNav"><a href="#skip.navbar.bottom" title="Skip navigation links">Skip navigation links</a></div>
 | 
			
		||||
                <a name="navbar.bottom.firstrow">
 | 
			
		||||
                    <!--   -->
 | 
			
		||||
                </a>
 | 
			
		||||
                <ul class="navList" title="Navigation">
 | 
			
		||||
                    <li><a href="../tours_hanoi/package-summary.html">Package</a></li>
 | 
			
		||||
                    <li class="navBarCell1Rev">Class</li>
 | 
			
		||||
                    <li><a href="package-tree.html">Tree</a></li>
 | 
			
		||||
                    <li><a href="../deprecated-list.html">Deprecated</a></li>
 | 
			
		||||
                    <li><a href="../index-all.html">Index</a></li>
 | 
			
		||||
                    <li><a href="../help-doc.html">Help</a></li>
 | 
			
		||||
                </ul>
 | 
			
		||||
            </div>
 | 
			
		||||
            <div class="subNav">
 | 
			
		||||
                <ul class="navList">
 | 
			
		||||
                    <li>Prev Class</li>
 | 
			
		||||
                    <li><a href="../tours_hanoi/HanoiState.Listener.html" title="interface in tours_hanoi"><span class="typeNameLink">Next Class</span></a></li>
 | 
			
		||||
                </ul>
 | 
			
		||||
                <ul class="navList">
 | 
			
		||||
                    <li><a href="../index.html?tours_hanoi/HanoiState.html" target="_top">Frames</a></li>
 | 
			
		||||
                    <li><a href="HanoiState.html" target="_top">No Frames</a></li>
 | 
			
		||||
                </ul>
 | 
			
		||||
                <ul class="navList" id="allclasses_navbar_bottom">
 | 
			
		||||
                    <li><a href="../allclasses-noframe.html">All Classes</a></li>
 | 
			
		||||
                </ul>
 | 
			
		||||
                <div>
 | 
			
		||||
                    <script type="text/javascript"><!--
 | 
			
		||||
                        allClassesLink = document.getElementById("allclasses_navbar_bottom");
 | 
			
		||||
  if(window==top) {
 | 
			
		||||
    allClassesLink.style.display = "block";
 | 
			
		||||
  }
 | 
			
		||||
  else {
 | 
			
		||||
    allClassesLink.style.display = "none";
 | 
			
		||||
  }
 | 
			
		||||
//-->
 | 
			
		||||
                    </script>
 | 
			
		||||
                </div>
 | 
			
		||||
                <div>
 | 
			
		||||
                    <ul class="subNavList">
 | 
			
		||||
                        <li>Summary: </li>
 | 
			
		||||
                        <li><a href="#nested.class.summary">Nested</a> | </li>
 | 
			
		||||
                        <li><a href="#field.summary">Field</a> | </li>
 | 
			
		||||
                        <li><a href="#constructor.summary">Constr</a> | </li>
 | 
			
		||||
                        <li><a href="#method.summary">Method</a></li>
 | 
			
		||||
                    </ul>
 | 
			
		||||
                    <ul class="subNavList">
 | 
			
		||||
                        <li>Detail: </li>
 | 
			
		||||
                        <li><a href="#field.detail">Field</a> | </li>
 | 
			
		||||
                        <li><a href="#constructor.detail">Constr</a> | </li>
 | 
			
		||||
                        <li><a href="#method.detail">Method</a></li>
 | 
			
		||||
                    </ul>
 | 
			
		||||
                </div>
 | 
			
		||||
                <a name="skip.navbar.bottom">
 | 
			
		||||
                    <!--   -->
 | 
			
		||||
                </a></div>
 | 
			
		||||
                <!-- ======== END OF BOTTOM NAVBAR ======= -->
 | 
			
		||||
    </body>
 | 
			
		||||
</html>
 | 
			
		||||
							
								
								
									
										127
									
								
								q2/tp2/hanoi/src/tours_hanoi/HanoiState.java
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										127
									
								
								q2/tp2/hanoi/src/tours_hanoi/HanoiState.java
									
									
									
									
									
										Normal file
									
								
							@ -0,0 +1,127 @@
 | 
			
		||||
package tours_hanoi;
 | 
			
		||||
 | 
			
		||||
import java.util.ArrayList;
 | 
			
		||||
import java.util.List;
 | 
			
		||||
import java.util.Stack;
 | 
			
		||||
 | 
			
		||||
public class HanoiState {
 | 
			
		||||
 | 
			
		||||
    /** Nombre de tours */
 | 
			
		||||
    public static final int NUM_TOWERS = 3;
 | 
			
		||||
 | 
			
		||||
    /** Nombre max. de pièces */
 | 
			
		||||
    public static final int MAX_DISKS = 20;
 | 
			
		||||
 | 
			
		||||
    /** Modèle d'une pièce (actuellement seulement sa taille (diamètre) */
 | 
			
		||||
    private static class Disk {
 | 
			
		||||
 | 
			
		||||
        /** Taille de la pièce */
 | 
			
		||||
        public final int size;
 | 
			
		||||
 | 
			
		||||
        /** Constructeur privé (factory) */
 | 
			
		||||
        private Disk(int size) {
 | 
			
		||||
            this.size = size;
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        /** Pièces créées */
 | 
			
		||||
        private static final Disk[] DISKS = new Disk[MAX_DISKS];
 | 
			
		||||
 | 
			
		||||
        /** Crée/retourne une pièce particulière */
 | 
			
		||||
        public static Disk getBySize(int size) {
 | 
			
		||||
            if (DISKS[size] == null)
 | 
			
		||||
                DISKS[size] = new Disk(size);
 | 
			
		||||
            return DISKS[size];
 | 
			
		||||
        }
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /** Une tour est une pile (empêche d'emblée les accès ailleurs qu'au sommet) */
 | 
			
		||||
    private Stack<Disk> towers[];
 | 
			
		||||
 | 
			
		||||
    private int countMoves = 0;
 | 
			
		||||
 | 
			
		||||
    /** Construit un jeu des Tours de Hanoï */
 | 
			
		||||
    @SuppressWarnings("unchecked")
 | 
			
		||||
    private HanoiState() {
 | 
			
		||||
        towers = (Stack<Disk>[]) java.lang.reflect.Array.newInstance(Stack.class, NUM_TOWERS);
 | 
			
		||||
        for (int i = 0; i < NUM_TOWERS; i++)
 | 
			
		||||
            towers[i] = new Stack<Disk>();
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /** Construit un jeu des Tours de Hanoï à n disques
 | 
			
		||||
     * @param n Le nombre de disques */
 | 
			
		||||
    public HanoiState(int n) {
 | 
			
		||||
        this();
 | 
			
		||||
        for (int i = 0; i < n; i++)
 | 
			
		||||
            add(0, Disk.getBySize(n - 1 - i));
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /** Ajoute une pièce au sommet d'une tour */
 | 
			
		||||
    private void add(int tower, Disk p) {
 | 
			
		||||
        towers[tower].push(p);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /** Déplace une pièce du sommet d'une tour au sommet d'une autre tour.
 | 
			
		||||
     *  Vérifie que les contraintes du jeu sont respectées.
 | 
			
		||||
     *  @param from Indice de la tours de départ
 | 
			
		||||
     *  @param to Indice de la tour d'arrivée*/
 | 
			
		||||
    public void move(int from, int to) {
 | 
			
		||||
        if (towers[from].empty())
 | 
			
		||||
            throw new RuntimeException("Pile source vide");
 | 
			
		||||
 | 
			
		||||
        if (!towers[to].empty() &&
 | 
			
		||||
                (towers[to].peek().size < towers[from].peek().size))
 | 
			
		||||
            throw new RuntimeException("Déplacement sur une pièce plus grande");
 | 
			
		||||
 | 
			
		||||
        towers[to].push(towers[from].pop());
 | 
			
		||||
 | 
			
		||||
        countMoves++;
 | 
			
		||||
 | 
			
		||||
        notifyListeners();
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /** Retourne le nombre de pièces sur la tour i
 | 
			
		||||
     * @param tower L'indice de la tour
 | 
			
		||||
     * @return Le nombre de pièces sur la tour*/
 | 
			
		||||
    public int getNumDisks(int tower) {
 | 
			
		||||
        return towers[tower].size();
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /** Retourne la taille de la pièce en position j de la tour i
 | 
			
		||||
     * @param tower L'indice de la tour
 | 
			
		||||
     * @param j La position de la pièce
 | 
			
		||||
     * @return La taille de la pièce en position j dans la tour*/
 | 
			
		||||
    public int getDiskSize(int tower, int j) {
 | 
			
		||||
        return towers[tower].get(j).size;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /** Retourne le nombre total de déplacements
 | 
			
		||||
     * @return Le nombre total de déplacements*/
 | 
			
		||||
    public int getMovesCount() {
 | 
			
		||||
        return countMoves;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    ////////////////////////////////////////////////////////////////
 | 
			
		||||
 | 
			
		||||
    /** Permet d'être notifié des changements d'états
 | 
			
		||||
     * (utilisé p.ex. par la fenêtre d'affichage) */
 | 
			
		||||
    public static interface Listener {
 | 
			
		||||
 | 
			
		||||
        public void stateChanged();
 | 
			
		||||
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /** Liste des listeners */
 | 
			
		||||
    private List<Listener> listeners = new ArrayList<Listener>();
 | 
			
		||||
 | 
			
		||||
    /** Notifie l'ensemble des listeners du changement d'état */
 | 
			
		||||
    private void notifyListeners() {
 | 
			
		||||
        for (Listener l : listeners)
 | 
			
		||||
            l.stateChanged();
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /** Enregistre un listener supplémentaire */
 | 
			
		||||
    public void addListener(Listener l) {
 | 
			
		||||
        listeners.add(l);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
}
 | 
			
		||||
							
								
								
									
										43
									
								
								q2/tp2/hanoi/src/tours_hanoi/Tester.java
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										43
									
								
								q2/tp2/hanoi/src/tours_hanoi/Tester.java
									
									
									
									
									
										Normal file
									
								
							@ -0,0 +1,43 @@
 | 
			
		||||
package tours_hanoi;
 | 
			
		||||
 | 
			
		||||
import javax.swing.JFrame;
 | 
			
		||||
 | 
			
		||||
public class Tester {
 | 
			
		||||
 | 
			
		||||
    /** Nombre de pièces à mettre en jeu
 | 
			
		||||
     *  (attention, le nombre de déplacements est de l'ordre de 2^N) */
 | 
			
		||||
    public static final int NUM_DISKS = 6;
 | 
			
		||||
 | 
			
		||||
    /** Délai entre l'affichage de deux mouvements (en millisecondes) */
 | 
			
		||||
    public static final int DELAY = 1000;
 | 
			
		||||
 | 
			
		||||
    /** Si cette constante vaut true, les mouvements des pièces sont affichés */
 | 
			
		||||
    public static final boolean SHOW_MOVES = true;
 | 
			
		||||
 | 
			
		||||
    /** Reference vers fenêtre d'affichage optionnelle */
 | 
			
		||||
    private static HanoiFrame f;
 | 
			
		||||
 | 
			
		||||
    /** Programme principal */
 | 
			
		||||
    public static void main(String [] args) {
 | 
			
		||||
        HanoiState state = new HanoiState(NUM_DISKS);
 | 
			
		||||
 | 
			
		||||
        if (SHOW_MOVES) {
 | 
			
		||||
            f = new HanoiFrame(state, DELAY);
 | 
			
		||||
        }
 | 
			
		||||
        solve(state, NUM_DISKS, 0, 2, 1);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * Déplace n pièces de la tour d'index tSrc vers la tour d'index tDst.
 | 
			
		||||
     *
 | 
			
		||||
     * @param state référence vers l'état des tours/pièces
 | 
			
		||||
     * @param n     nombre de pièces à déplacer
 | 
			
		||||
     * @param tSrc  index tour source
 | 
			
		||||
     * @param tDst  index tour destination
 | 
			
		||||
     * @param tInt  index tour intermédiaire
 | 
			
		||||
     */
 | 
			
		||||
    private static void solve(HanoiState state, int n, int tSrc, int tDst, int tInt) {
 | 
			
		||||
        state.move(tSrc, tDst);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
}
 | 
			
		||||
							
								
								
									
										574
									
								
								q2/tp2/hanoi/src/tours_hanoi/stylesheet.css
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										574
									
								
								q2/tp2/hanoi/src/tours_hanoi/stylesheet.css
									
									
									
									
									
										Normal file
									
								
							@ -0,0 +1,574 @@
 | 
			
		||||
/* Javadoc style sheet */
 | 
			
		||||
/*
 | 
			
		||||
Overall document style
 | 
			
		||||
*/
 | 
			
		||||
 | 
			
		||||
@import url('resources/fonts/dejavu.css');
 | 
			
		||||
 | 
			
		||||
body {
 | 
			
		||||
    background-color:#ffffff;
 | 
			
		||||
    color:#353833;
 | 
			
		||||
    font-family:'DejaVu Sans', Arial, Helvetica, sans-serif;
 | 
			
		||||
    font-size:14px;
 | 
			
		||||
    margin:0;
 | 
			
		||||
}
 | 
			
		||||
a:link, a:visited {
 | 
			
		||||
    text-decoration:none;
 | 
			
		||||
    color:#4A6782;
 | 
			
		||||
}
 | 
			
		||||
a:hover, a:focus {
 | 
			
		||||
    text-decoration:none;
 | 
			
		||||
    color:#bb7a2a;
 | 
			
		||||
}
 | 
			
		||||
a:active {
 | 
			
		||||
    text-decoration:none;
 | 
			
		||||
    color:#4A6782;
 | 
			
		||||
}
 | 
			
		||||
a[name] {
 | 
			
		||||
    color:#353833;
 | 
			
		||||
}
 | 
			
		||||
a[name]:hover {
 | 
			
		||||
    text-decoration:none;
 | 
			
		||||
    color:#353833;
 | 
			
		||||
}
 | 
			
		||||
pre {
 | 
			
		||||
    font-family:'DejaVu Sans Mono', monospace;
 | 
			
		||||
    font-size:14px;
 | 
			
		||||
}
 | 
			
		||||
h1 {
 | 
			
		||||
    font-size:20px;
 | 
			
		||||
}
 | 
			
		||||
h2 {
 | 
			
		||||
    font-size:18px;
 | 
			
		||||
}
 | 
			
		||||
h3 {
 | 
			
		||||
    font-size:16px;
 | 
			
		||||
    font-style:italic;
 | 
			
		||||
}
 | 
			
		||||
h4 {
 | 
			
		||||
    font-size:13px;
 | 
			
		||||
}
 | 
			
		||||
h5 {
 | 
			
		||||
    font-size:12px;
 | 
			
		||||
}
 | 
			
		||||
h6 {
 | 
			
		||||
    font-size:11px;
 | 
			
		||||
}
 | 
			
		||||
ul {
 | 
			
		||||
    list-style-type:disc;
 | 
			
		||||
}
 | 
			
		||||
code, tt {
 | 
			
		||||
    font-family:'DejaVu Sans Mono', monospace;
 | 
			
		||||
    font-size:14px;
 | 
			
		||||
    padding-top:4px;
 | 
			
		||||
    margin-top:8px;
 | 
			
		||||
    line-height:1.4em;
 | 
			
		||||
}
 | 
			
		||||
dt code {
 | 
			
		||||
    font-family:'DejaVu Sans Mono', monospace;
 | 
			
		||||
    font-size:14px;
 | 
			
		||||
    padding-top:4px;
 | 
			
		||||
}
 | 
			
		||||
table tr td dt code {
 | 
			
		||||
    font-family:'DejaVu Sans Mono', monospace;
 | 
			
		||||
    font-size:14px;
 | 
			
		||||
    vertical-align:top;
 | 
			
		||||
    padding-top:4px;
 | 
			
		||||
}
 | 
			
		||||
sup {
 | 
			
		||||
    font-size:8px;
 | 
			
		||||
}
 | 
			
		||||
/*
 | 
			
		||||
Document title and Copyright styles
 | 
			
		||||
*/
 | 
			
		||||
.clear {
 | 
			
		||||
    clear:both;
 | 
			
		||||
    height:0px;
 | 
			
		||||
    overflow:hidden;
 | 
			
		||||
}
 | 
			
		||||
.aboutLanguage {
 | 
			
		||||
    float:right;
 | 
			
		||||
    padding:0px 21px;
 | 
			
		||||
    font-size:11px;
 | 
			
		||||
    z-index:200;
 | 
			
		||||
    margin-top:-9px;
 | 
			
		||||
}
 | 
			
		||||
.legalCopy {
 | 
			
		||||
    margin-left:.5em;
 | 
			
		||||
}
 | 
			
		||||
.bar a, .bar a:link, .bar a:visited, .bar a:active {
 | 
			
		||||
    color:#FFFFFF;
 | 
			
		||||
    text-decoration:none;
 | 
			
		||||
}
 | 
			
		||||
.bar a:hover, .bar a:focus {
 | 
			
		||||
    color:#bb7a2a;
 | 
			
		||||
}
 | 
			
		||||
.tab {
 | 
			
		||||
    background-color:#0066FF;
 | 
			
		||||
    color:#ffffff;
 | 
			
		||||
    padding:8px;
 | 
			
		||||
    width:5em;
 | 
			
		||||
    font-weight:bold;
 | 
			
		||||
}
 | 
			
		||||
/*
 | 
			
		||||
Navigation bar styles
 | 
			
		||||
*/
 | 
			
		||||
.bar {
 | 
			
		||||
    background-color:#4D7A97;
 | 
			
		||||
    color:#FFFFFF;
 | 
			
		||||
    padding:.8em .5em .4em .8em;
 | 
			
		||||
    height:auto;/*height:1.8em;*/
 | 
			
		||||
    font-size:11px;
 | 
			
		||||
    margin:0;
 | 
			
		||||
}
 | 
			
		||||
.topNav {
 | 
			
		||||
    background-color:#4D7A97;
 | 
			
		||||
    color:#FFFFFF;
 | 
			
		||||
    float:left;
 | 
			
		||||
    padding:0;
 | 
			
		||||
    width:100%;
 | 
			
		||||
    clear:right;
 | 
			
		||||
    height:2.8em;
 | 
			
		||||
    padding-top:10px;
 | 
			
		||||
    overflow:hidden;
 | 
			
		||||
    font-size:12px; 
 | 
			
		||||
}
 | 
			
		||||
.bottomNav {
 | 
			
		||||
    margin-top:10px;
 | 
			
		||||
    background-color:#4D7A97;
 | 
			
		||||
    color:#FFFFFF;
 | 
			
		||||
    float:left;
 | 
			
		||||
    padding:0;
 | 
			
		||||
    width:100%;
 | 
			
		||||
    clear:right;
 | 
			
		||||
    height:2.8em;
 | 
			
		||||
    padding-top:10px;
 | 
			
		||||
    overflow:hidden;
 | 
			
		||||
    font-size:12px;
 | 
			
		||||
}
 | 
			
		||||
.subNav {
 | 
			
		||||
    background-color:#dee3e9;
 | 
			
		||||
    float:left;
 | 
			
		||||
    width:100%;
 | 
			
		||||
    overflow:hidden;
 | 
			
		||||
    font-size:12px;
 | 
			
		||||
}
 | 
			
		||||
.subNav div {
 | 
			
		||||
    clear:left;
 | 
			
		||||
    float:left;
 | 
			
		||||
    padding:0 0 5px 6px;
 | 
			
		||||
    text-transform:uppercase;
 | 
			
		||||
}
 | 
			
		||||
ul.navList, ul.subNavList {
 | 
			
		||||
    float:left;
 | 
			
		||||
    margin:0 25px 0 0;
 | 
			
		||||
    padding:0;
 | 
			
		||||
}
 | 
			
		||||
ul.navList li{
 | 
			
		||||
    list-style:none;
 | 
			
		||||
    float:left;
 | 
			
		||||
    padding: 5px 6px;
 | 
			
		||||
    text-transform:uppercase;
 | 
			
		||||
}
 | 
			
		||||
ul.subNavList li{
 | 
			
		||||
    list-style:none;
 | 
			
		||||
    float:left;
 | 
			
		||||
}
 | 
			
		||||
.topNav a:link, .topNav a:active, .topNav a:visited, .bottomNav a:link, .bottomNav a:active, .bottomNav a:visited {
 | 
			
		||||
    color:#FFFFFF;
 | 
			
		||||
    text-decoration:none;
 | 
			
		||||
    text-transform:uppercase;
 | 
			
		||||
}
 | 
			
		||||
.topNav a:hover, .bottomNav a:hover {
 | 
			
		||||
    text-decoration:none;
 | 
			
		||||
    color:#bb7a2a;
 | 
			
		||||
    text-transform:uppercase;
 | 
			
		||||
}
 | 
			
		||||
.navBarCell1Rev {
 | 
			
		||||
    background-color:#F8981D;
 | 
			
		||||
    color:#253441;
 | 
			
		||||
    margin: auto 5px;
 | 
			
		||||
}
 | 
			
		||||
.skipNav {
 | 
			
		||||
    position:absolute;
 | 
			
		||||
    top:auto;
 | 
			
		||||
    left:-9999px;
 | 
			
		||||
    overflow:hidden;
 | 
			
		||||
}
 | 
			
		||||
/*
 | 
			
		||||
Page header and footer styles
 | 
			
		||||
*/
 | 
			
		||||
.header, .footer {
 | 
			
		||||
    clear:both;
 | 
			
		||||
    margin:0 20px;
 | 
			
		||||
    padding:5px 0 0 0;
 | 
			
		||||
}
 | 
			
		||||
.indexHeader {
 | 
			
		||||
    margin:10px;
 | 
			
		||||
    position:relative;
 | 
			
		||||
}
 | 
			
		||||
.indexHeader span{
 | 
			
		||||
    margin-right:15px;
 | 
			
		||||
}
 | 
			
		||||
.indexHeader h1 {
 | 
			
		||||
    font-size:13px;
 | 
			
		||||
}
 | 
			
		||||
.title {
 | 
			
		||||
    color:#2c4557;
 | 
			
		||||
    margin:10px 0;
 | 
			
		||||
}
 | 
			
		||||
.subTitle {
 | 
			
		||||
    margin:5px 0 0 0;
 | 
			
		||||
}
 | 
			
		||||
.header ul {
 | 
			
		||||
    margin:0 0 15px 0;
 | 
			
		||||
    padding:0;
 | 
			
		||||
}
 | 
			
		||||
.footer ul {
 | 
			
		||||
    margin:20px 0 5px 0;
 | 
			
		||||
}
 | 
			
		||||
.header ul li, .footer ul li {
 | 
			
		||||
    list-style:none;
 | 
			
		||||
    font-size:13px;
 | 
			
		||||
}
 | 
			
		||||
/*
 | 
			
		||||
Heading styles
 | 
			
		||||
*/
 | 
			
		||||
div.details ul.blockList ul.blockList ul.blockList li.blockList h4, div.details ul.blockList ul.blockList ul.blockListLast li.blockList h4 {
 | 
			
		||||
    background-color:#dee3e9;
 | 
			
		||||
    border:1px solid #d0d9e0;
 | 
			
		||||
    margin:0 0 6px -8px;
 | 
			
		||||
    padding:7px 5px;
 | 
			
		||||
}
 | 
			
		||||
ul.blockList ul.blockList ul.blockList li.blockList h3 {
 | 
			
		||||
    background-color:#dee3e9;
 | 
			
		||||
    border:1px solid #d0d9e0;
 | 
			
		||||
    margin:0 0 6px -8px;
 | 
			
		||||
    padding:7px 5px;
 | 
			
		||||
}
 | 
			
		||||
ul.blockList ul.blockList li.blockList h3 {
 | 
			
		||||
    padding:0;
 | 
			
		||||
    margin:15px 0;
 | 
			
		||||
}
 | 
			
		||||
ul.blockList li.blockList h2 {
 | 
			
		||||
    padding:0px 0 20px 0;
 | 
			
		||||
}
 | 
			
		||||
/*
 | 
			
		||||
Page layout container styles
 | 
			
		||||
*/
 | 
			
		||||
.contentContainer, .sourceContainer, .classUseContainer, .serializedFormContainer, .constantValuesContainer {
 | 
			
		||||
    clear:both;
 | 
			
		||||
    padding:10px 20px;
 | 
			
		||||
    position:relative;
 | 
			
		||||
}
 | 
			
		||||
.indexContainer {
 | 
			
		||||
    margin:10px;
 | 
			
		||||
    position:relative;
 | 
			
		||||
    font-size:12px;
 | 
			
		||||
}
 | 
			
		||||
.indexContainer h2 {
 | 
			
		||||
    font-size:13px;
 | 
			
		||||
    padding:0 0 3px 0;
 | 
			
		||||
}
 | 
			
		||||
.indexContainer ul {
 | 
			
		||||
    margin:0;
 | 
			
		||||
    padding:0;
 | 
			
		||||
}
 | 
			
		||||
.indexContainer ul li {
 | 
			
		||||
    list-style:none;
 | 
			
		||||
    padding-top:2px;
 | 
			
		||||
}
 | 
			
		||||
.contentContainer .description dl dt, .contentContainer .details dl dt, .serializedFormContainer dl dt {
 | 
			
		||||
    font-size:12px;
 | 
			
		||||
    font-weight:bold;
 | 
			
		||||
    margin:10px 0 0 0;
 | 
			
		||||
    color:#4E4E4E;
 | 
			
		||||
}
 | 
			
		||||
.contentContainer .description dl dd, .contentContainer .details dl dd, .serializedFormContainer dl dd {
 | 
			
		||||
    margin:5px 0 10px 0px;
 | 
			
		||||
    font-size:14px;
 | 
			
		||||
    font-family:'DejaVu Sans Mono',monospace;
 | 
			
		||||
}
 | 
			
		||||
.serializedFormContainer dl.nameValue dt {
 | 
			
		||||
    margin-left:1px;
 | 
			
		||||
    font-size:1.1em;
 | 
			
		||||
    display:inline;
 | 
			
		||||
    font-weight:bold;
 | 
			
		||||
}
 | 
			
		||||
.serializedFormContainer dl.nameValue dd {
 | 
			
		||||
    margin:0 0 0 1px;
 | 
			
		||||
    font-size:1.1em;
 | 
			
		||||
    display:inline;
 | 
			
		||||
}
 | 
			
		||||
/*
 | 
			
		||||
List styles
 | 
			
		||||
*/
 | 
			
		||||
ul.horizontal li {
 | 
			
		||||
    display:inline;
 | 
			
		||||
    font-size:0.9em;
 | 
			
		||||
}
 | 
			
		||||
ul.inheritance {
 | 
			
		||||
    margin:0;
 | 
			
		||||
    padding:0;
 | 
			
		||||
}
 | 
			
		||||
ul.inheritance li {
 | 
			
		||||
    display:inline;
 | 
			
		||||
    list-style:none;
 | 
			
		||||
}
 | 
			
		||||
ul.inheritance li ul.inheritance {
 | 
			
		||||
    margin-left:15px;
 | 
			
		||||
    padding-left:15px;
 | 
			
		||||
    padding-top:1px;
 | 
			
		||||
}
 | 
			
		||||
ul.blockList, ul.blockListLast {
 | 
			
		||||
    margin:10px 0 10px 0;
 | 
			
		||||
    padding:0;
 | 
			
		||||
}
 | 
			
		||||
ul.blockList li.blockList, ul.blockListLast li.blockList {
 | 
			
		||||
    list-style:none;
 | 
			
		||||
    margin-bottom:15px;
 | 
			
		||||
    line-height:1.4;
 | 
			
		||||
}
 | 
			
		||||
ul.blockList ul.blockList li.blockList, ul.blockList ul.blockListLast li.blockList {
 | 
			
		||||
    padding:0px 20px 5px 10px;
 | 
			
		||||
    border:1px solid #ededed; 
 | 
			
		||||
    background-color:#f8f8f8;
 | 
			
		||||
}
 | 
			
		||||
ul.blockList ul.blockList ul.blockList li.blockList, ul.blockList ul.blockList ul.blockListLast li.blockList {
 | 
			
		||||
    padding:0 0 5px 8px;
 | 
			
		||||
    background-color:#ffffff;
 | 
			
		||||
    border:none;
 | 
			
		||||
}
 | 
			
		||||
ul.blockList ul.blockList ul.blockList ul.blockList li.blockList {
 | 
			
		||||
    margin-left:0;
 | 
			
		||||
    padding-left:0;
 | 
			
		||||
    padding-bottom:15px;
 | 
			
		||||
    border:none;
 | 
			
		||||
}
 | 
			
		||||
ul.blockList ul.blockList ul.blockList ul.blockList li.blockListLast {
 | 
			
		||||
    list-style:none;
 | 
			
		||||
    border-bottom:none;
 | 
			
		||||
    padding-bottom:0;
 | 
			
		||||
}
 | 
			
		||||
table tr td dl, table tr td dl dt, table tr td dl dd {
 | 
			
		||||
    margin-top:0;
 | 
			
		||||
    margin-bottom:1px;
 | 
			
		||||
}
 | 
			
		||||
/*
 | 
			
		||||
Table styles
 | 
			
		||||
*/
 | 
			
		||||
.overviewSummary, .memberSummary, .typeSummary, .useSummary, .constantsSummary, .deprecatedSummary {
 | 
			
		||||
    width:100%;
 | 
			
		||||
    border-left:1px solid #EEE; 
 | 
			
		||||
    border-right:1px solid #EEE; 
 | 
			
		||||
    border-bottom:1px solid #EEE; 
 | 
			
		||||
}
 | 
			
		||||
.overviewSummary, .memberSummary  {
 | 
			
		||||
    padding:0px;
 | 
			
		||||
}
 | 
			
		||||
.overviewSummary caption, .memberSummary caption, .typeSummary caption,
 | 
			
		||||
.useSummary caption, .constantsSummary caption, .deprecatedSummary caption {
 | 
			
		||||
    position:relative;
 | 
			
		||||
    text-align:left;
 | 
			
		||||
    background-repeat:no-repeat;
 | 
			
		||||
    color:#253441;
 | 
			
		||||
    font-weight:bold;
 | 
			
		||||
    clear:none;
 | 
			
		||||
    overflow:hidden;
 | 
			
		||||
    padding:0px;
 | 
			
		||||
    padding-top:10px;
 | 
			
		||||
    padding-left:1px;
 | 
			
		||||
    margin:0px;
 | 
			
		||||
    white-space:pre;
 | 
			
		||||
}
 | 
			
		||||
.overviewSummary caption a:link, .memberSummary caption a:link, .typeSummary caption a:link,
 | 
			
		||||
.useSummary caption a:link, .constantsSummary caption a:link, .deprecatedSummary caption a:link,
 | 
			
		||||
.overviewSummary caption a:hover, .memberSummary caption a:hover, .typeSummary caption a:hover,
 | 
			
		||||
.useSummary caption a:hover, .constantsSummary caption a:hover, .deprecatedSummary caption a:hover,
 | 
			
		||||
.overviewSummary caption a:active, .memberSummary caption a:active, .typeSummary caption a:active,
 | 
			
		||||
.useSummary caption a:active, .constantsSummary caption a:active, .deprecatedSummary caption a:active,
 | 
			
		||||
.overviewSummary caption a:visited, .memberSummary caption a:visited, .typeSummary caption a:visited,
 | 
			
		||||
.useSummary caption a:visited, .constantsSummary caption a:visited, .deprecatedSummary caption a:visited {
 | 
			
		||||
    color:#FFFFFF;
 | 
			
		||||
}
 | 
			
		||||
.overviewSummary caption span, .memberSummary caption span, .typeSummary caption span,
 | 
			
		||||
.useSummary caption span, .constantsSummary caption span, .deprecatedSummary caption span {
 | 
			
		||||
    white-space:nowrap;
 | 
			
		||||
    padding-top:5px;
 | 
			
		||||
    padding-left:12px;
 | 
			
		||||
    padding-right:12px;
 | 
			
		||||
    padding-bottom:7px;
 | 
			
		||||
    display:inline-block;
 | 
			
		||||
    float:left;
 | 
			
		||||
    background-color:#F8981D;
 | 
			
		||||
    border: none;
 | 
			
		||||
    height:16px;
 | 
			
		||||
}
 | 
			
		||||
.memberSummary caption span.activeTableTab span {
 | 
			
		||||
    white-space:nowrap;
 | 
			
		||||
    padding-top:5px;
 | 
			
		||||
    padding-left:12px;
 | 
			
		||||
    padding-right:12px;
 | 
			
		||||
    margin-right:3px;
 | 
			
		||||
    display:inline-block;
 | 
			
		||||
    float:left;
 | 
			
		||||
    background-color:#F8981D;
 | 
			
		||||
    height:16px;
 | 
			
		||||
}
 | 
			
		||||
.memberSummary caption span.tableTab span {
 | 
			
		||||
    white-space:nowrap;
 | 
			
		||||
    padding-top:5px;
 | 
			
		||||
    padding-left:12px;
 | 
			
		||||
    padding-right:12px;
 | 
			
		||||
    margin-right:3px;
 | 
			
		||||
    display:inline-block;
 | 
			
		||||
    float:left;
 | 
			
		||||
    background-color:#4D7A97;
 | 
			
		||||
    height:16px;
 | 
			
		||||
}
 | 
			
		||||
.memberSummary caption span.tableTab, .memberSummary caption span.activeTableTab {
 | 
			
		||||
    padding-top:0px;
 | 
			
		||||
    padding-left:0px;
 | 
			
		||||
    padding-right:0px;
 | 
			
		||||
    background-image:none;
 | 
			
		||||
    float:none;
 | 
			
		||||
    display:inline;
 | 
			
		||||
}
 | 
			
		||||
.overviewSummary .tabEnd, .memberSummary .tabEnd, .typeSummary .tabEnd,
 | 
			
		||||
.useSummary .tabEnd, .constantsSummary .tabEnd, .deprecatedSummary .tabEnd {
 | 
			
		||||
    display:none;
 | 
			
		||||
    width:5px;
 | 
			
		||||
    position:relative;
 | 
			
		||||
    float:left;
 | 
			
		||||
    background-color:#F8981D;
 | 
			
		||||
}
 | 
			
		||||
.memberSummary .activeTableTab .tabEnd {
 | 
			
		||||
    display:none;
 | 
			
		||||
    width:5px;
 | 
			
		||||
    margin-right:3px;
 | 
			
		||||
    position:relative; 
 | 
			
		||||
    float:left;
 | 
			
		||||
    background-color:#F8981D;
 | 
			
		||||
}
 | 
			
		||||
.memberSummary .tableTab .tabEnd {
 | 
			
		||||
    display:none;
 | 
			
		||||
    width:5px;
 | 
			
		||||
    margin-right:3px;
 | 
			
		||||
    position:relative;
 | 
			
		||||
    background-color:#4D7A97;
 | 
			
		||||
    float:left;
 | 
			
		||||
 | 
			
		||||
}
 | 
			
		||||
.overviewSummary td, .memberSummary td, .typeSummary td,
 | 
			
		||||
.useSummary td, .constantsSummary td, .deprecatedSummary td {
 | 
			
		||||
    text-align:left;
 | 
			
		||||
    padding:0px 0px 12px 10px;
 | 
			
		||||
}
 | 
			
		||||
th.colOne, th.colFirst, th.colLast, .useSummary th, .constantsSummary th,
 | 
			
		||||
td.colOne, td.colFirst, td.colLast, .useSummary td, .constantsSummary td{
 | 
			
		||||
    vertical-align:top;
 | 
			
		||||
    padding-right:0px;
 | 
			
		||||
    padding-top:8px;
 | 
			
		||||
    padding-bottom:3px;
 | 
			
		||||
}
 | 
			
		||||
th.colFirst, th.colLast, th.colOne, .constantsSummary th {
 | 
			
		||||
    background:#dee3e9;
 | 
			
		||||
    text-align:left;
 | 
			
		||||
    padding:8px 3px 3px 7px;
 | 
			
		||||
}
 | 
			
		||||
td.colFirst, th.colFirst {
 | 
			
		||||
    white-space:nowrap;
 | 
			
		||||
    font-size:13px;
 | 
			
		||||
}
 | 
			
		||||
td.colLast, th.colLast {
 | 
			
		||||
    font-size:13px;
 | 
			
		||||
}
 | 
			
		||||
td.colOne, th.colOne {
 | 
			
		||||
    font-size:13px;
 | 
			
		||||
}
 | 
			
		||||
.overviewSummary td.colFirst, .overviewSummary th.colFirst,
 | 
			
		||||
.useSummary td.colFirst, .useSummary th.colFirst,
 | 
			
		||||
.overviewSummary td.colOne, .overviewSummary th.colOne,
 | 
			
		||||
.memberSummary td.colFirst, .memberSummary th.colFirst,
 | 
			
		||||
.memberSummary td.colOne, .memberSummary th.colOne,
 | 
			
		||||
.typeSummary td.colFirst{
 | 
			
		||||
    width:25%;
 | 
			
		||||
    vertical-align:top;
 | 
			
		||||
}
 | 
			
		||||
td.colOne a:link, td.colOne a:active, td.colOne a:visited, td.colOne a:hover, td.colFirst a:link, td.colFirst a:active, td.colFirst a:visited, td.colFirst a:hover, td.colLast a:link, td.colLast a:active, td.colLast a:visited, td.colLast a:hover, .constantValuesContainer td a:link, .constantValuesContainer td a:active, .constantValuesContainer td a:visited, .constantValuesContainer td a:hover {
 | 
			
		||||
    font-weight:bold;
 | 
			
		||||
}
 | 
			
		||||
.tableSubHeadingColor {
 | 
			
		||||
    background-color:#EEEEFF;
 | 
			
		||||
}
 | 
			
		||||
.altColor {
 | 
			
		||||
    background-color:#FFFFFF;
 | 
			
		||||
}
 | 
			
		||||
.rowColor {
 | 
			
		||||
    background-color:#EEEEEF;
 | 
			
		||||
}
 | 
			
		||||
/*
 | 
			
		||||
Content styles
 | 
			
		||||
*/
 | 
			
		||||
.description pre {
 | 
			
		||||
    margin-top:0;
 | 
			
		||||
}
 | 
			
		||||
.deprecatedContent {
 | 
			
		||||
    margin:0;
 | 
			
		||||
    padding:10px 0;
 | 
			
		||||
}
 | 
			
		||||
.docSummary {
 | 
			
		||||
    padding:0;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
ul.blockList ul.blockList ul.blockList li.blockList h3 {
 | 
			
		||||
    font-style:normal;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
div.block {
 | 
			
		||||
    font-size:14px;
 | 
			
		||||
    font-family:'DejaVu Serif', Georgia, "Times New Roman", Times, serif;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
td.colLast div {
 | 
			
		||||
    padding-top:0px;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
td.colLast a {
 | 
			
		||||
    padding-bottom:3px;
 | 
			
		||||
}
 | 
			
		||||
/*
 | 
			
		||||
Formatting effect styles
 | 
			
		||||
*/
 | 
			
		||||
.sourceLineNo {
 | 
			
		||||
    color:green;
 | 
			
		||||
    padding:0 30px 0 0;
 | 
			
		||||
}
 | 
			
		||||
h1.hidden {
 | 
			
		||||
    visibility:hidden;
 | 
			
		||||
    overflow:hidden;
 | 
			
		||||
    font-size:10px;
 | 
			
		||||
}
 | 
			
		||||
.block {
 | 
			
		||||
    display:block;
 | 
			
		||||
    margin:3px 10px 2px 0px;
 | 
			
		||||
    color:#474747;
 | 
			
		||||
}
 | 
			
		||||
.deprecatedLabel, .descfrmTypeLabel, .memberNameLabel, .memberNameLink,
 | 
			
		||||
.overrideSpecifyLabel, .packageHierarchyLabel, .paramLabel, .returnLabel,
 | 
			
		||||
.seeLabel, .simpleTagLabel, .throwsLabel, .typeNameLabel, .typeNameLink {
 | 
			
		||||
    font-weight:bold;
 | 
			
		||||
}
 | 
			
		||||
.deprecationComment, .emphasizedPhrase, .interfaceName {
 | 
			
		||||
    font-style:italic;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
div.block div.block span.deprecationComment, div.block div.block span.emphasizedPhrase,
 | 
			
		||||
div.block div.block span.interfaceName {
 | 
			
		||||
    font-style:normal;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
div.contentContainer ul.blockList li.blockList h2{
 | 
			
		||||
    padding-bottom:0px;
 | 
			
		||||
}
 | 
			
		||||
							
								
								
									
										8
									
								
								q2/tp2/recursif/.idea/.gitignore
									
									
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										8
									
								
								q2/tp2/recursif/.idea/.gitignore
									
									
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							@ -0,0 +1,8 @@
 | 
			
		||||
# Default ignored files
 | 
			
		||||
/shelf/
 | 
			
		||||
/workspace.xml
 | 
			
		||||
# Editor-based HTTP Client requests
 | 
			
		||||
/httpRequests/
 | 
			
		||||
# Datasource local storage ignored files
 | 
			
		||||
/dataSources/
 | 
			
		||||
/dataSources.local.xml
 | 
			
		||||
							
								
								
									
										6
									
								
								q2/tp2/recursif/.idea/misc.xml
									
									
									
										generated
									
									
									
										Normal file
									
								
							
							
						
						
									
										6
									
								
								q2/tp2/recursif/.idea/misc.xml
									
									
									
										generated
									
									
									
										Normal file
									
								
							@ -0,0 +1,6 @@
 | 
			
		||||
<?xml version="1.0" encoding="UTF-8"?>
 | 
			
		||||
<project version="4">
 | 
			
		||||
  <component name="ProjectRootManager">
 | 
			
		||||
    <output url="file://$PROJECT_DIR$/out" />
 | 
			
		||||
  </component>
 | 
			
		||||
</project>
 | 
			
		||||
							
								
								
									
										8
									
								
								q2/tp2/recursif/.idea/modules.xml
									
									
									
										generated
									
									
									
										Normal file
									
								
							
							
						
						
									
										8
									
								
								q2/tp2/recursif/.idea/modules.xml
									
									
									
										generated
									
									
									
										Normal file
									
								
							@ -0,0 +1,8 @@
 | 
			
		||||
<?xml version="1.0" encoding="UTF-8"?>
 | 
			
		||||
<project version="4">
 | 
			
		||||
  <component name="ProjectModuleManager">
 | 
			
		||||
    <modules>
 | 
			
		||||
      <module fileurl="file://$PROJECT_DIR$/recursif.iml" filepath="$PROJECT_DIR$/recursif.iml" />
 | 
			
		||||
    </modules>
 | 
			
		||||
  </component>
 | 
			
		||||
</project>
 | 
			
		||||
							
								
								
									
										6
									
								
								q2/tp2/recursif/.idea/vcs.xml
									
									
									
										generated
									
									
									
										Normal file
									
								
							
							
						
						
									
										6
									
								
								q2/tp2/recursif/.idea/vcs.xml
									
									
									
										generated
									
									
									
										Normal file
									
								
							@ -0,0 +1,6 @@
 | 
			
		||||
<?xml version="1.0" encoding="UTF-8"?>
 | 
			
		||||
<project version="4">
 | 
			
		||||
  <component name="VcsDirectoryMappings">
 | 
			
		||||
    <mapping directory="$PROJECT_DIR$/../../.." vcs="Git" />
 | 
			
		||||
  </component>
 | 
			
		||||
</project>
 | 
			
		||||
							
								
								
									
										8
									
								
								q2/tp2/recursif/recursif.iml
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										8
									
								
								q2/tp2/recursif/recursif.iml
									
									
									
									
									
										Normal file
									
								
							@ -0,0 +1,8 @@
 | 
			
		||||
<?xml version="1.0" encoding="UTF-8"?>
 | 
			
		||||
<module type="GENERAL_MODULE" version="4">
 | 
			
		||||
  <component name="NewModuleRootManager" inherit-compiler-output="true">
 | 
			
		||||
    <exclude-output />
 | 
			
		||||
    <content url="file://$MODULE_DIR$" />
 | 
			
		||||
    <orderEntry type="sourceFolder" forTests="false" />
 | 
			
		||||
  </component>
 | 
			
		||||
</module>
 | 
			
		||||
		Reference in New Issue
	
	Block a user