Compare commits
4 Commits
c585c54
...
8d88f01c9d
Author | SHA1 | Date | |
---|---|---|---|
8d88f01c9d
|
|||
e983c5aa13
|
|||
498529f29a
|
|||
e06abe60de
|
49
.drone.yml
49
.drone.yml
@ -1,49 +0,0 @@
|
|||||||
---
|
|
||||||
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
|
|
||||||
|
|
||||||
...
|
|
@ -4,7 +4,3 @@
|
|||||||
|
|
||||||
- [Première entrevue](./rapports/130223.md)
|
- [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)
|
|
@ -1,60 +0,0 @@
|
|||||||
|
|
||||||
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,5 +1,3 @@
|
|||||||
# School_Project
|
# School_Project
|
||||||
|
|
||||||
[](http://drone.herisson.ovh/undefined_name/School_Project)
|
|
||||||
|
|
||||||
School Project based on Cats Organized Neatly
|
School Project based on Cats Organized Neatly
|
20
app/src/main/java/school_project/Map.java
Normal file
20
app/src/main/java/school_project/Map.java
Normal file
@ -0,0 +1,20 @@
|
|||||||
|
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);
|
||||||
|
}
|
||||||
|
}
|
31
app/src/main/java/school_project/Piece.java
Normal file
31
app/src/main/java/school_project/Piece.java
Normal file
@ -0,0 +1,31 @@
|
|||||||
|
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;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
40
app/src/main/java/school_project/Shape.java
Normal file
40
app/src/main/java/school_project/Shape.java
Normal file
@ -0,0 +1,40 @@
|
|||||||
|
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;
|
||||||
|
}
|
||||||
|
}
|
60
app/src/test/java/school_project/PieceTest.java
Normal file
60
app/src/test/java/school_project/PieceTest.java
Normal file
@ -0,0 +1,60 @@
|
|||||||
|
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());
|
||||||
|
}
|
||||||
|
}
|
48
app/src/test/java/school_project/ShapeTest.java
Normal file
48
app/src/test/java/school_project/ShapeTest.java
Normal file
@ -0,0 +1,48 @@
|
|||||||
|
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
BIN
gradle/wrapper/gradle-wrapper.jar
vendored
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
|
distributionBase=GRADLE_USER_HOME
|
||||||
distributionPath=wrapper/dists
|
distributionPath=wrapper/dists
|
||||||
distributionUrl=https\://services.gradle.org/distributions/gradle-7.6-bin.zip
|
distributionUrl=https\://services.gradle.org/distributions/gradle-8.0-bin.zip
|
||||||
networkTimeout=10000
|
networkTimeout=10000
|
||||||
zipStoreBase=GRADLE_USER_HOME
|
zipStoreBase=GRADLE_USER_HOME
|
||||||
zipStorePath=wrapper/dists
|
zipStorePath=wrapper/dists
|
||||||
|
@ -1,82 +0,0 @@
|
|||||||
#!/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
|
|
@ -1,77 +0,0 @@
|
|||||||
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