Compare commits
	
		
			30 Commits
		
	
	
		
			a1e36ccbc7
			...
			c585c54
		
	
	| Author | SHA1 | Date | |
|---|---|---|---|
| c585c54da2 | |||
| 1740ad2e13 | |||
| 04fd342a57 | |||
| dfc6056767 | |||
| 1837d976aa | |||
| f5bd36f4e0 | |||
| 716e874b7e | |||
| 3ab6ff1bfa | |||
| f08ed98897 | |||
| aafb5f5c66 | |||
| bbfc5687d9 | |||
| 922497573b | |||
| e55b17fcd8 | |||
| 08c4a08a01 | |||
| 207195c0c8 | |||
| ec7692f8d3 | |||
| 5c4dc5c370 | |||
| bc05260ba7 | |||
| 36c79daa4e | |||
| 5a45ab43ba | |||
| c70e30b629 | |||
| a55dcc678a | |||
| d5b8da4f21 | |||
| 2ef6bdb9ed | |||
| 2d9a4d2aec | |||
| acd786744b | |||
| cc11b0d882 | |||
| 3b6c21f4b4 | |||
| 4608208b7f | |||
| 29b73a31b3 | 
							
								
								
									
										49
									
								
								.drone.yml
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										49
									
								
								.drone.yml
									
									
									
									
									
										Normal file
									
								
							@ -0,0 +1,49 @@
 | 
			
		||||
---
 | 
			
		||||
kind: pipeline
 | 
			
		||||
type: docker
 | 
			
		||||
name: Check_Requirement
 | 
			
		||||
 | 
			
		||||
steps:
 | 
			
		||||
  - name: base_check
 | 
			
		||||
    image: gradle:jdk11-alpine 
 | 
			
		||||
    commands:
 | 
			
		||||
      - ./gradlew clean
 | 
			
		||||
      - ./gradlew build
 | 
			
		||||
      - ./gradlew test
 | 
			
		||||
 | 
			
		||||
  - name: syntax_check
 | 
			
		||||
    image: gradle:jdk11-alpine 
 | 
			
		||||
    commands:
 | 
			
		||||
      - ./gradlew check
 | 
			
		||||
 | 
			
		||||
---
 | 
			
		||||
kind: pipeline
 | 
			
		||||
type: docker
 | 
			
		||||
name: master_build
 | 
			
		||||
 | 
			
		||||
steps:
 | 
			
		||||
  - name: make_archive
 | 
			
		||||
    image: alpine:latest
 | 
			
		||||
    volumes: 
 | 
			
		||||
      - name: archives
 | 
			
		||||
        path: /build
 | 
			
		||||
    commands:
 | 
			
		||||
      - apk add --no-cache git
 | 
			
		||||
      - tar cvzf /build/$(git log -n 1 --format="%h")_school_archive.gz.tar app/ gradle/ gradlew/ gradlew.bat README.md settings.gradle
 | 
			
		||||
    trigger:
 | 
			
		||||
      branch:
 | 
			
		||||
        - master
 | 
			
		||||
      event:
 | 
			
		||||
        exclude:
 | 
			
		||||
          - pull_request
 | 
			
		||||
volumes: 
 | 
			
		||||
  - name: archives
 | 
			
		||||
    host:
 | 
			
		||||
      path: /srv/drone/school_project/archive/
 | 
			
		||||
depends_on:
 | 
			
		||||
  - Check_Requirement
 | 
			
		||||
---
 | 
			
		||||
kind: signature
 | 
			
		||||
hmac: 7560f21ac377e3e6d1c30a67cf6a1052574560d57bbe98cc8017ebcaf19cfc99
 | 
			
		||||
 | 
			
		||||
...
 | 
			
		||||
@ -3,4 +3,8 @@
 | 
			
		||||
# Rapports 
 | 
			
		||||
 | 
			
		||||
- [Première entrevue](./rapports/130223.md)
 | 
			
		||||
- [Deuxième entrevue](./rapports/200223.md)
 | 
			
		||||
- [Deuxième entrevue](./rapports/200223.md)
 | 
			
		||||
 | 
			
		||||
# Histoire
 | 
			
		||||
 | 
			
		||||
- [Plot Story](./histoire/plot_story.md)
 | 
			
		||||
							
								
								
									
										60
									
								
								JournalDeBord/src/histoire/plot_story.md
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										60
									
								
								JournalDeBord/src/histoire/plot_story.md
									
									
									
									
									
										Normal file
									
								
							@ -0,0 +1,60 @@
 | 
			
		||||
 | 
			
		||||
Intro histoire 
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
Après notre premier quadri à l unif assez compliqué entre calculus, inégalités et physique 
 | 
			
		||||
et la perte de temps dans les transports en commun.
 | 
			
		||||
Je décide de enfin me prendre un kot à Mons pour réussir ce quadri en beauté 
 | 
			
		||||
 | 
			
		||||
intro à jouer 
 | 
			
		||||
 | 
			
		||||
Faire les cartons de différentes cours 
 | 
			
		||||
Calculus --> big carton( encombrant pas possible de tourner) 
 | 
			
		||||
Algo 1 --> pc portable (fragile)
 | 
			
		||||
Math elem carton avec une inégalité dessus qui change dès qu on tourne la pièce) 
 | 
			
		||||
Objet perso à chacun 
 | 
			
		||||
Mat --> poids de sport
 | 
			
		||||
Eddy --> balle de basket,...
 | 
			
		||||
Anthony --> tenue de scout 
 | 
			
		||||
 | 
			
		||||
Déménagement histoire  :
 | 
			
		||||
 | 
			
		||||
Arrivé à l appartement :
 | 
			
		||||
La pièce est assez petite mais avec assez d'imagination je serai tout mettre
 | 
			
		||||
(j'aurais aimé déjà être en master pour faire une AI qui me aiderai à ranger tous 
 | 
			
		||||
ça peut-etre que chatgpt pourrait m aider..)
 | 
			
		||||
 | 
			
		||||
Déménagement à jouer :
 | 
			
		||||
 | 
			
		||||
Galère à tout rangé --> (interaction avec le jouer)
 | 
			
		||||
--> en repensant c est peut-être pour ça que l ancien propriétaire et partie et que le prix était de si bas
 | 
			
		||||
Notion de jour donc cours unifs -> pas le temps de ranger dans le WK on doit terminer en semaine
 | 
			
		||||
 | 
			
		||||
continuité histoire 
 | 
			
		||||
 | 
			
		||||
Après un long mardi terminer par le cours d algo 2 il est 
 | 
			
		||||
tant de ranger le dernier carton dans la buanderie après une 10 minute de marche 
 | 
			
		||||
j arrive à mon kot mais qlq chose à changer, la couleur de la porte n est plus la même. 
 | 
			
		||||
De plus il faut tirer et plus poussé pour l ouvrir.
 | 
			
		||||
Après être rentré tous les cartons sont refait et l ordre des pièces à changer
 | 
			
		||||
 | 
			
		||||
à jouer
 | 
			
		||||
 | 
			
		||||
----> refaire des niveaux différents pour ranger les cartons
 | 
			
		||||
 | 
			
		||||
(intercation pendant le jeu)
 | 
			
		||||
-->Hormis la fatigue qui me gagne et se sentiment étrange par rapport à ce kot 
 | 
			
		||||
je defais encore une fois tous mes cartons 
 | 
			
		||||
(je ne sais pas comment mais tout mes exo en calculus ont été corrigées les cartons sont tous remplie de rouge lol) 
 | 
			
		||||
 | 
			
		||||
Day 2 histoire
 | 
			
		||||
 | 
			
		||||
Après avoir défait le dernier carton dans le bureau je remarque une Trap mystérieuse mais il est déjà 23h et demain j'ai une longue journée qui m'attend (8-10 et 15h45-17h45)
 | 
			
		||||
La nuit passe --> rien ne bouge
 | 
			
		||||
(Level bonus) 
 | 
			
		||||
(choix entre faire le petit dej ou allez directement en cours)
 | 
			
		||||
Après un bon petit déj --> puzzle cassé les oeuf au bonne endroit dans la poêle 
 | 
			
		||||
mettre le bacon au bonne endroit
 | 
			
		||||
La journée se termine je croise les doigts pour que tout reste comme avant 
 | 
			
		||||
Puis on ouvre la Trap est...  space cat avec qlq level 
 | 
			
		||||
ou reveil devant l examen de calculus
 | 
			
		||||
@ -1,3 +1,5 @@
 | 
			
		||||
# School_Project
 | 
			
		||||
 | 
			
		||||
[](http://drone.herisson.ovh/undefined_name/School_Project)
 | 
			
		||||
 | 
			
		||||
School Project based on Cats Organized Neatly
 | 
			
		||||
@ -1,20 +0,0 @@
 | 
			
		||||
package school_project;
 | 
			
		||||
 | 
			
		||||
import java.util.ArrayList;
 | 
			
		||||
 | 
			
		||||
public class Map extends Shape{
 | 
			
		||||
    private ArrayList<Piece> pieces;
 | 
			
		||||
 | 
			
		||||
    public Map(boolean[][] matrix) {
 | 
			
		||||
        super(matrix);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    public Map() {
 | 
			
		||||
        super();
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    // TODO: 2/27/23 Tests for Map 
 | 
			
		||||
    public void AddShape(Piece piece){
 | 
			
		||||
        pieces.add(piece);
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
@ -1,44 +0,0 @@
 | 
			
		||||
package school_project;
 | 
			
		||||
 | 
			
		||||
import java.io.*;
 | 
			
		||||
import java.lang.reflect.Array;
 | 
			
		||||
import java.util.Arrays;
 | 
			
		||||
 | 
			
		||||
public class MapParser {
 | 
			
		||||
    public static Map ParseMapFile(File file) throws IllegalArgumentException, IllegalAccessException, IOException {
 | 
			
		||||
        System.out.println(file.getAbsolutePath());
 | 
			
		||||
        FileInputStream fileStream = new FileInputStream(file);
 | 
			
		||||
        if(!file.isFile()) throw new IllegalArgumentException("The argument should be a file");
 | 
			
		||||
        if(!file.canRead()) throw new IllegalAccessException("This file can't be read");
 | 
			
		||||
 | 
			
		||||
        byte[] bytes = fileStream.readAllBytes();
 | 
			
		||||
        int start_position = 0, end_position = 0;
 | 
			
		||||
        for (int i = 0; i < bytes.length; i++) {
 | 
			
		||||
            if(bytes[i] == 83 && bytes[i+1] == 77 && bytes[i+2] == 83){ // SMS
 | 
			
		||||
                start_position = i+3;
 | 
			
		||||
                break;
 | 
			
		||||
            }
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        for (int i = start_position; i < bytes.length; i++) {
 | 
			
		||||
            if(bytes[i] == 83 && bytes[i+1] == 77 && bytes[i+2] == 69){ // SME
 | 
			
		||||
                end_position = i;
 | 
			
		||||
                break;
 | 
			
		||||
            }
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        byte[] map_data = Arrays.copyOfRange(bytes, start_position, end_position); //TODO tonitch cursor
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
        fileStream.close();
 | 
			
		||||
        return new Map(); //TODO: Send the parsed map
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
//    public static void SaveMapFile(File file){
 | 
			
		||||
//    }
 | 
			
		||||
 | 
			
		||||
    public static void main(String[] args) throws IOException, IllegalAccessException {
 | 
			
		||||
        ParseMapFile(new File("test.smap"));
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
}
 | 
			
		||||
@ -1,31 +0,0 @@
 | 
			
		||||
package school_project;
 | 
			
		||||
 | 
			
		||||
public class Piece extends Shape{
 | 
			
		||||
 | 
			
		||||
    private int x,y; // Position in the Map Object
 | 
			
		||||
    public Piece() {
 | 
			
		||||
        super();
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    public Piece(boolean[][] matrix) {
 | 
			
		||||
        super(matrix);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * Rotate the matrix of the piece. Used when the player right click
 | 
			
		||||
     *
 | 
			
		||||
     * @param times Set the amount of time the rotation should be executed. Should be set between 1 and 3.
 | 
			
		||||
     */
 | 
			
		||||
    public void RotateRight(int times){
 | 
			
		||||
        while(times > 0) {
 | 
			
		||||
            boolean[][] temp_matrix = new boolean[width][height];
 | 
			
		||||
            for (int i = 0; i < width; i++) {
 | 
			
		||||
                for (int j = 0; j < height; j++) {
 | 
			
		||||
                    temp_matrix[i][j] = matrix[-j+height-1][i];
 | 
			
		||||
                }
 | 
			
		||||
            }
 | 
			
		||||
            times--;
 | 
			
		||||
            matrix = temp_matrix;
 | 
			
		||||
        }
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
@ -1,40 +0,0 @@
 | 
			
		||||
package school_project;
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
public class Shape {
 | 
			
		||||
 | 
			
		||||
    protected boolean[][] matrix;
 | 
			
		||||
    protected int height, width;
 | 
			
		||||
 | 
			
		||||
    public Shape() {
 | 
			
		||||
        matrix = new boolean[0][0];
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    public Shape(boolean[][] matrix){
 | 
			
		||||
        this.setShape(matrix);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    public void setShape(boolean[][] matrix) throws IllegalArgumentException{
 | 
			
		||||
        height = matrix.length;
 | 
			
		||||
        width = matrix[0].length;
 | 
			
		||||
 | 
			
		||||
        for (boolean[] row: matrix){
 | 
			
		||||
            if(row.length != width){
 | 
			
		||||
                throw new IllegalArgumentException("The argument should be a square matrix");
 | 
			
		||||
            }
 | 
			
		||||
        }
 | 
			
		||||
        this.matrix = matrix;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    public int getHeight() {
 | 
			
		||||
        return height;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    public int getWidth() {
 | 
			
		||||
        return width;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    public boolean[][] getShape() {
 | 
			
		||||
        return matrix;
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
@ -1,60 +0,0 @@
 | 
			
		||||
package school_project;
 | 
			
		||||
 | 
			
		||||
import org.junit.jupiter.api.Test;
 | 
			
		||||
 | 
			
		||||
import static org.junit.jupiter.api.Assertions.*;
 | 
			
		||||
 | 
			
		||||
class PieceTest {
 | 
			
		||||
 | 
			
		||||
    @Test
 | 
			
		||||
    void rotateRight() {
 | 
			
		||||
        boolean[][] piece1_matrix = {
 | 
			
		||||
            {true, false, false},
 | 
			
		||||
            {false, true, false},
 | 
			
		||||
            {true, true, false},
 | 
			
		||||
        };
 | 
			
		||||
 | 
			
		||||
        boolean[][] piece1_matrix_result = {
 | 
			
		||||
                {true, false, true},
 | 
			
		||||
                {true, true, false},
 | 
			
		||||
                {false, false, false},
 | 
			
		||||
        };
 | 
			
		||||
 | 
			
		||||
        boolean[][] piece2_matrix = {
 | 
			
		||||
                {true},
 | 
			
		||||
                {false},
 | 
			
		||||
                {true},
 | 
			
		||||
        };
 | 
			
		||||
 | 
			
		||||
        boolean[][] piece2_matrix_result = {
 | 
			
		||||
                {true, false, true},
 | 
			
		||||
        };
 | 
			
		||||
 | 
			
		||||
        boolean[][] piece3_matrix_result = {
 | 
			
		||||
                {false, false, false},
 | 
			
		||||
                {false, true, true},
 | 
			
		||||
                {true, false, true},
 | 
			
		||||
        };
 | 
			
		||||
 | 
			
		||||
        Piece piece1 = new Piece();
 | 
			
		||||
        piece1.setShape(piece1_matrix);
 | 
			
		||||
 | 
			
		||||
        Piece piece2 = new Piece(piece2_matrix);
 | 
			
		||||
 | 
			
		||||
        Piece piece3 = new Piece(piece1_matrix);
 | 
			
		||||
 | 
			
		||||
        Piece piece4 = new Piece(piece1_matrix);
 | 
			
		||||
 | 
			
		||||
        piece1.RotateRight(1);
 | 
			
		||||
        assertArrayEquals(piece1_matrix_result, piece1.getShape());
 | 
			
		||||
 | 
			
		||||
        piece2.RotateRight(1);
 | 
			
		||||
        assertArrayEquals(piece2_matrix_result, piece2.getShape());
 | 
			
		||||
 | 
			
		||||
        piece3.RotateRight(3);
 | 
			
		||||
        assertArrayEquals(piece3_matrix_result, piece3.getShape());
 | 
			
		||||
 | 
			
		||||
        piece4.RotateRight(3);
 | 
			
		||||
        assertNotEquals(piece1_matrix_result, piece4.getShape());
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
@ -1,48 +0,0 @@
 | 
			
		||||
package school_project;
 | 
			
		||||
 | 
			
		||||
import org.junit.jupiter.api.Test;
 | 
			
		||||
 | 
			
		||||
import static org.junit.jupiter.api.Assertions.*;
 | 
			
		||||
 | 
			
		||||
class ShapeTest {
 | 
			
		||||
 | 
			
		||||
    @Test
 | 
			
		||||
    void setShape() {
 | 
			
		||||
        boolean[][] matrix_shape1 = {
 | 
			
		||||
                {true, false},
 | 
			
		||||
                {true, true},
 | 
			
		||||
                {true, false}
 | 
			
		||||
        };
 | 
			
		||||
        boolean[][] matrix_shape2 = {
 | 
			
		||||
                {true, false, true},
 | 
			
		||||
                {true, true, true},
 | 
			
		||||
                {true, false, true},
 | 
			
		||||
        };
 | 
			
		||||
        boolean[][] matrix_shape3 = {
 | 
			
		||||
                {true, false, true},
 | 
			
		||||
                {true, true}
 | 
			
		||||
        };
 | 
			
		||||
 | 
			
		||||
        boolean[][] matrix_shape4 = {
 | 
			
		||||
                {true},
 | 
			
		||||
                {false},
 | 
			
		||||
                {true}
 | 
			
		||||
        };
 | 
			
		||||
 | 
			
		||||
        Shape shape1 = new Shape();
 | 
			
		||||
        shape1.setShape(matrix_shape1);
 | 
			
		||||
        assertEquals(3, shape1.getHeight());
 | 
			
		||||
        assertEquals(2, shape1.getWidth());
 | 
			
		||||
 | 
			
		||||
        Shape shape2 = new Shape(matrix_shape2);
 | 
			
		||||
        assertEquals(3, shape2.getHeight());
 | 
			
		||||
        assertEquals(3, shape2.getWidth());
 | 
			
		||||
 | 
			
		||||
        assertThrows(IllegalArgumentException.class, () -> new Shape(matrix_shape3));
 | 
			
		||||
 | 
			
		||||
        Shape shape4 = new Shape(matrix_shape4);
 | 
			
		||||
        assertEquals(3, shape4.getHeight());
 | 
			
		||||
        assertEquals(1, shape4.getWidth());
 | 
			
		||||
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
							
								
								
									
										
											BIN
										
									
								
								gradle/wrapper/gradle-wrapper.jar
									
									
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										
											BIN
										
									
								
								gradle/wrapper/gradle-wrapper.jar
									
									
									
									
										vendored
									
									
										Normal file
									
								
							
										
											Binary file not shown.
										
									
								
							
							
								
								
									
										2
									
								
								gradle/wrapper/gradle-wrapper.properties
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										2
									
								
								gradle/wrapper/gradle-wrapper.properties
									
									
									
									
										vendored
									
									
								
							@ -1,6 +1,6 @@
 | 
			
		||||
distributionBase=GRADLE_USER_HOME
 | 
			
		||||
distributionPath=wrapper/dists
 | 
			
		||||
distributionUrl=https\://services.gradle.org/distributions/gradle-8.0-bin.zip
 | 
			
		||||
distributionUrl=https\://services.gradle.org/distributions/gradle-7.6-bin.zip
 | 
			
		||||
networkTimeout=10000
 | 
			
		||||
zipStoreBase=GRADLE_USER_HOME
 | 
			
		||||
zipStorePath=wrapper/dists
 | 
			
		||||
 | 
			
		||||
							
								
								
									
										4
									
								
								gradlew
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										4
									
								
								gradlew
									
									
									
									
										vendored
									
									
								
							@ -144,7 +144,7 @@ if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then
 | 
			
		||||
    case $MAX_FD in #(
 | 
			
		||||
      max*)
 | 
			
		||||
        # In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked.
 | 
			
		||||
        # shellcheck disable=SC3045
 | 
			
		||||
        # shellcheck disable=SC3045 
 | 
			
		||||
        MAX_FD=$( ulimit -H -n ) ||
 | 
			
		||||
            warn "Could not query maximum file descriptor limit"
 | 
			
		||||
    esac
 | 
			
		||||
@ -152,7 +152,7 @@ if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then
 | 
			
		||||
      '' | soft) :;; #(
 | 
			
		||||
      *)
 | 
			
		||||
        # In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked.
 | 
			
		||||
        # shellcheck disable=SC3045
 | 
			
		||||
        # shellcheck disable=SC3045 
 | 
			
		||||
        ulimit -n "$MAX_FD" ||
 | 
			
		||||
            warn "Could not set maximum file descriptor limit to $MAX_FD"
 | 
			
		||||
    esac
 | 
			
		||||
 | 
			
		||||
							
								
								
									
										82
									
								
								misc/pre-commit.sh
									
									
									
									
									
										Executable file
									
								
							
							
						
						
									
										82
									
								
								misc/pre-commit.sh
									
									
									
									
									
										Executable file
									
								
							@ -0,0 +1,82 @@
 | 
			
		||||
#!/bin/sh
 | 
			
		||||
 | 
			
		||||
echo 'Lovely Idea';
 | 
			
		||||
 | 
			
		||||
BASE_DIR="$(dirname $(readlink -f $0))/.."
 | 
			
		||||
cd $BASE_DIR
 | 
			
		||||
echo $BASE_DIR
 | 
			
		||||
 | 
			
		||||
function clean() {
 | 
			
		||||
	echo "Cleaning the folder"
 | 
			
		||||
	$BASE_DIR/gradlew clean
 | 
			
		||||
	
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
function build() {
 | 
			
		||||
	echo "Building the project"
 | 
			
		||||
	$BASE_DIR/gradlew build
 | 
			
		||||
	
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
function test() {
 | 
			
		||||
	echo "Testing the project"
 | 
			
		||||
	$BASE_DIR/gradlew test
 | 
			
		||||
	
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
function run() {
 | 
			
		||||
	echo "Running the project"
 | 
			
		||||
	$BASE_DIR/gradlew run &
 | 
			
		||||
	_PID=$!
 | 
			
		||||
	sleep 3
 | 
			
		||||
	killpid $_PID
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
function check_syntax() {
 | 
			
		||||
	echo "Checking the syntax"
 | 
			
		||||
	echo 'TODO Tonitch: check syntax script'
 | 
			
		||||
	
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
function make_archive() {
 | 
			
		||||
	echo "Creating the archive on the parent folder"
 | 
			
		||||
	tar --create --gzip --exclude-vcs --exclude-vcs-ignores -f ../archive.tar.gz "${BASE_DIR}/{app/, gradle/, gralew, gradlew.bat, settings.gradle}"
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
case $1 in
 | 
			
		||||
 | 
			
		||||
	clean )
 | 
			
		||||
		clean ;;
 | 
			
		||||
 | 
			
		||||
	build )
 | 
			
		||||
		build ;;
 | 
			
		||||
 | 
			
		||||
	test )
 | 
			
		||||
		test ;;
 | 
			
		||||
 | 
			
		||||
	run )
 | 
			
		||||
		run ;;
 | 
			
		||||
 | 
			
		||||
	syntax )
 | 
			
		||||
		check_syntax ;;
 | 
			
		||||
 | 
			
		||||
	archive )
 | 
			
		||||
		clean &&
 | 
			
		||||
		build &&
 | 
			
		||||
		test &&
 | 
			
		||||
		run &&
 | 
			
		||||
		check_syntax &&
 | 
			
		||||
		make_archive ;;
 | 
			
		||||
 | 
			
		||||
	all )
 | 
			
		||||
		clean &&
 | 
			
		||||
		build &&
 | 
			
		||||
		test &&
 | 
			
		||||
		run &&
 | 
			
		||||
		check_syntax ;;
 | 
			
		||||
	* )
 | 
			
		||||
		clean &&
 | 
			
		||||
		build &&
 | 
			
		||||
		test &&
 | 
			
		||||
		check_syntax ;;
 | 
			
		||||
esac
 | 
			
		||||
							
								
								
									
										77
									
								
								prototypes/cat_puzzle.py
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										77
									
								
								prototypes/cat_puzzle.py
									
									
									
									
									
										Normal file
									
								
							@ -0,0 +1,77 @@
 | 
			
		||||
import os
 | 
			
		||||
import rotate_matrix
 | 
			
		||||
def turn_piece(piece):      #based on a matrix MxN ie [(0,0),(0,0),(0,0)] m = 3 and n = 2
 | 
			
		||||
    new_piece = rotate_matrix.clockwise(piece)
 | 
			
		||||
    return new_piece
 | 
			
		||||
    
 | 
			
		||||
game = True
 | 
			
		||||
while game:
 | 
			
		||||
    print('Bienvenue dans le jeu cat puzzle')
 | 
			
		||||
 | 
			
		||||
    choose_level = 0
 | 
			
		||||
    while choose_level == 0:
 | 
			
		||||
        choose_level = input('Choissisez un niveau à résoudre\n')   #choose a level of the game
 | 
			
		||||
        try:
 | 
			
		||||
            choose_level = int(choose_level)
 | 
			
		||||
        except ValueError:
 | 
			
		||||
            choose_level= 0
 | 
			
		||||
            print('Il me faut un nombre')
 | 
			
		||||
        if choose_level!=1:
 | 
			
		||||
            choose_level = 0
 | 
			
		||||
            print('Il n\'existe que le niveau 1 pour l\'instant')
 | 
			
		||||
 | 
			
		||||
    print('Découvrons ensemeble le niveau',choose_level)     #make a first level
 | 
			
		||||
 | 
			
		||||
    if choose_level ==1:        #select the level one and print it 
 | 
			
		||||
        level_one = [(1,1,1),(1,1,0),(1,1,1)]
 | 
			
		||||
        print(level_one[0])
 | 
			
		||||
        print(level_one[1])
 | 
			
		||||
        print(level_one[2])
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
    print('Voilà les pièces que vous disposez pour complèter le puzzle')     #make piece for resolve the puzzle 
 | 
			
		||||
    
 | 
			
		||||
    piece_for_level = {
 | 
			
		||||
        1:[(1,1),(1,0)],2:[(1,0),(1,0),(1,0)],3:[(1,1)]}
 | 
			
		||||
    
 | 
			
		||||
 | 
			
		||||
    print('Voilà la pièce 1:')     #show the piece at the player
 | 
			
		||||
    for i in piece_for_level[1]:
 | 
			
		||||
        print(i)
 | 
			
		||||
 | 
			
		||||
    print('Voilà la pièce 2:')
 | 
			
		||||
    for i in piece_for_level[2]:
 | 
			
		||||
        print(i)
 | 
			
		||||
 | 
			
		||||
    print('Voilà la pièce 3:')
 | 
			
		||||
    for i in piece_for_level[3]:
 | 
			
		||||
        print(i)
 | 
			
		||||
 | 
			
		||||
    choose_piece = 0
 | 
			
		||||
    while choose_piece ==0:
 | 
			
		||||
        choose_piece = input('Choissisez la pièce que vous voulez bouger ? ')   #choice of the piece to move 
 | 
			
		||||
        try:
 | 
			
		||||
            choose_piece = int(choose_piece)  
 | 
			
		||||
        except ValueError:
 | 
			
		||||
            choose_piece =0
 | 
			
		||||
            print('J\'ai besoin d\'un nombre')
 | 
			
		||||
 | 
			
		||||
    
 | 
			
		||||
 | 
			
		||||
    move_piece = input('Voulez vous tournez la pièce ? (o/n)\n')
 | 
			
		||||
    if move_piece== 'o':
 | 
			
		||||
        print('Voilà la pièce tourner')
 | 
			
		||||
        piece_turn = turn_piece(piece_for_level[choose_piece])
 | 
			
		||||
        for i in piece_turn:
 | 
			
		||||
            print(i)
 | 
			
		||||
        
 | 
			
		||||
    m = input('A quelle ligne voulez-vous mettre la pièce ? ')
 | 
			
		||||
    n = input("A quelle colonne voulez-vous mettre la pièce ? ")
 | 
			
		||||
    m,n=m-1,n-1
 | 
			
		||||
    
 | 
			
		||||
    
 | 
			
		||||
 | 
			
		||||
    game=False
 | 
			
		||||
    
 | 
			
		||||
    
 | 
			
		||||
os.system('pause')
 | 
			
		||||
		Reference in New Issue
	
	Block a user