30 Commits

Author SHA1 Message Date
c585c54da2 fixing drone
All checks were successful
continuous-integration/drone/push Build is passing
continuous-integration/drone/tag Build is passing
2023-03-21 14:54:48 +01:00
1740ad2e13 Merge pull request 'deplacement du fichier texte de l'histoire' (#21) from Story into master
All checks were successful
continuous-integration/drone/push Build is passing
Reviewed-on: #21
Reviewed-by: Debucquoy Anthony <d.tonitch@gmail.com>
2023-03-17 15:07:48 +01:00
Mat
04fd342a57 deplacement du fichier texte de l'histoire
All checks were successful
continuous-integration/drone/push Build is passing
continuous-integration/drone/pr Build is passing
2023-03-17 15:03:16 +01:00
dfc6056767 Merge pull request 'story' (#20) from undefined_name/School_Project#8 into master
All checks were successful
continuous-integration/drone/push Build is passing
Reviewed-on: #20
2023-03-17 14:53:46 +01:00
1837d976aa Merge branch 'master' into undefined_name/School_Project#8
All checks were successful
continuous-integration/drone/pr Build is passing
continuous-integration/drone/push Build is passing
2023-03-17 13:40:48 +01:00
Mat
f5bd36f4e0 premier test 2023-03-16 11:01:10 +01:00
Mat
716e874b7e test add storie 2023-03-10 11:08:00 +01:00
3ab6ff1bfa Merge branch 'master' of git.herisson.ovh:undefined_name/School_project
All checks were successful
continuous-integration/drone/push Build is passing
2023-03-04 18:59:04 +01:00
f08ed98897 signing 2023-03-04 18:58:14 +01:00
aafb5f5c66 Update 'README.md'
Some checks reported errors
continuous-integration/drone/push Build encountered an error
2023-03-04 16:15:42 +01:00
bbfc5687d9 fix ci
Some checks reported errors
continuous-integration/drone/push Build encountered an error
2023-03-04 15:36:11 +01:00
922497573b fixup! fixup! fixup! fixup! fixup! maybe finishing ci? hopefully
Some checks reported errors
continuous-integration/drone/push Build encountered an error
2023-03-04 15:14:38 +01:00
e55b17fcd8 fixup! fixup! fixup! fixup! maybe finishing ci? hopefully
Some checks reported errors
continuous-integration/drone/push Build encountered an error
2023-03-04 15:13:21 +01:00
08c4a08a01 fixup! fixup! fixup! maybe finishing ci? hopefully
Some checks reported errors
continuous-integration/drone/push Build encountered an error
2023-03-04 15:12:15 +01:00
207195c0c8 fixup! fixup! maybe finishing ci? hopefully
Some checks reported errors
continuous-integration/drone/push Build encountered an error
2023-03-04 15:05:17 +01:00
ec7692f8d3 fixup! maybe finishing ci? hopefully
Some checks reported errors
continuous-integration/drone/push Build encountered an error
2023-03-04 14:59:37 +01:00
5c4dc5c370 maybe finishing ci? hopefully
Some checks reported errors
continuous-integration/drone/push Build encountered an error
2023-03-04 14:53:38 +01:00
bc05260ba7 adding missing wraper
Some checks failed
continuous-integration/drone/push Build is failing
2023-03-04 14:21:14 +01:00
36c79daa4e fixup! fixup! fixup! fixup! adding drone ci
Some checks failed
continuous-integration/drone/push Build is failing
2023-03-04 14:05:59 +01:00
5a45ab43ba fixup! fixup! fixup! adding drone ci
Some checks reported errors
continuous-integration/drone/push Build encountered an error
2023-03-04 14:05:04 +01:00
c70e30b629 fixup! fixup! adding drone ci
Some checks failed
continuous-integration/drone/push Build is failing
2023-03-04 14:00:22 +01:00
a55dcc678a fixup! adding drone ci
Some checks reported errors
continuous-integration/drone/push Build encountered an error
2023-03-04 13:56:10 +01:00
d5b8da4f21 adding drone ci
Some checks reported errors
continuous-integration/drone/push Build encountered an error
2023-03-04 13:49:40 +01:00
2ef6bdb9ed Merge pull request 'pre-commit script for linux' (#17) from pre-commit-linux-script into master
Reviewed-on: #17
2023-03-04 10:50:39 +01:00
2d9a4d2aec pre-commit script for linux 2023-03-04 10:47:07 +01:00
acd786744b Merge pull request 'cleaning up some stuff don't worry' (#16) from test into master
Reviewed-on: #16
2023-03-01 23:58:50 +01:00
Mat
cc11b0d882 final version 2023-02-19 11:50:40 +01:00
Mat
3b6c21f4b4 add turn piece 2023-02-19 11:50:24 +01:00
Mat
4608208b7f add choose level and correct spelling 2023-02-13 19:27:55 +01:00
Mat
29b73a31b3 mon prototype 2023-02-13 16:20:05 +01:00
15 changed files with 278 additions and 247 deletions

49
.drone.yml Normal file
View 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
...

View File

@ -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)

View 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

View File

@ -1,3 +1,5 @@
# School_Project
[![Build Status](http://drone.herisson.ovh/api/badges/undefined_name/School_Project/status.svg)](http://drone.herisson.ovh/undefined_name/School_Project)
School Project based on Cats Organized Neatly

View File

@ -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);
}
}

View File

@ -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"));
}
}

View File

@ -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;
}
}
}

View File

@ -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;
}
}

View File

@ -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());
}
}

View File

@ -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

Binary file not shown.

View File

@ -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
View File

@ -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
View 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
View 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')