init
This commit is contained in:
31
exam-basedir07/subjects/biggest_pal/subject.en.txt
Normal file
31
exam-basedir07/subjects/biggest_pal/subject.en.txt
Normal file
@@ -0,0 +1,31 @@
|
||||
Assignment name : biggest_pal
|
||||
Expected files : *.c, *.h
|
||||
Allowed functions: write
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
Write a program named biggest_pal that takes a string as argument and prints the
|
||||
biggest palindrome included inside this string, followed by a newline.
|
||||
|
||||
This string contains only lowercase characters.
|
||||
|
||||
If there is two palindromes of the same length, you have to print the last one.
|
||||
|
||||
If there is more or less than 1 argument, your program must print only a newline
|
||||
only.
|
||||
|
||||
Exemples:
|
||||
|
||||
$> biggest_pal "abcba"
|
||||
abcba
|
||||
$> biggest_pal "aaaaaaaaaabbcbbaaaa"
|
||||
aaaabbcbbaaaa
|
||||
$> biggest_pal "aooibdaoiwhoihwdoinzeldaisaboyobasiadlezfdsfnslk"
|
||||
zeldaisaboyobasiadlez
|
||||
$> biggest_pal "aeibaabaammaabaalek"
|
||||
aabaammaabaa
|
||||
$> biggest_pal abeb qpinqwjobo qkmnwoiq
|
||||
|
||||
$> biggest_pal
|
||||
|
||||
$>
|
||||
|
||||
31
exam-basedir07/subjects/biggest_pal/subject.fr.txt
Normal file
31
exam-basedir07/subjects/biggest_pal/subject.fr.txt
Normal file
@@ -0,0 +1,31 @@
|
||||
Assignment name : biggest_pal
|
||||
Expected files : *.c, *.h
|
||||
Allowed functions: write
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
Écrire un programme nommé biggest_pal, qui prend en paramètre une chaîne de
|
||||
caractères, et qui affiche le plus grand palindrome trouvé dans cette chaîne suivi
|
||||
d'une newline.
|
||||
|
||||
La chaine passée en paramètre ne contient uniquement que des lettres minuscules.
|
||||
|
||||
Si il y a 2 palindromes de meme taille, celui à imprimer sera le dernier rencontré.
|
||||
|
||||
Si le programme reçoit un nombre d'arguments différent de 1, vous ne renverrez
|
||||
qu'une newline.
|
||||
|
||||
Exemples:
|
||||
|
||||
$> biggest_pal "abcba"
|
||||
abcba
|
||||
$> biggest_pal "aaaaaaaaaabbcbbaaaa"
|
||||
aaaabbcbbaaaa
|
||||
$> biggest_pal "aooibdaoiwhoihwdoinzeldaisaboyobasiadlezfdsfnslk"
|
||||
zeldaisaboyobasiadlez
|
||||
$> biggest_pal "aeibaabaammaabaalek"
|
||||
aabaammaabaa
|
||||
$> biggest_pal abeb qpinqwjobo qkmnwoiq
|
||||
|
||||
$> biggest_pal
|
||||
|
||||
$>
|
||||
31
exam-basedir07/subjects/brackets/subject.en.txt
Normal file
31
exam-basedir07/subjects/brackets/subject.en.txt
Normal file
@@ -0,0 +1,31 @@
|
||||
Assignment name : brackets
|
||||
Expected files : *.c *.h
|
||||
Allowed functions: write
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
Write a program that takes an undefined number of strings in arguments. For each
|
||||
argument, the program prints on the standard output "OK" followed by a newline
|
||||
if the expression is correctly bracketed, otherwise it prints "Error" followed by
|
||||
a newline.
|
||||
|
||||
Symbols considered as 'brackets' are brackets '(' and ')', square brackets '['
|
||||
and ']'and braces '{' and '}'. Every other symbols are simply ignored.
|
||||
|
||||
An opening bracket must always be closed by the good closing bracket in the
|
||||
correct order. A string which not contains any bracket is considered as a
|
||||
correctly bracketed string.
|
||||
|
||||
If there is no arguments, the program must print only a newline.
|
||||
|
||||
Examples :
|
||||
|
||||
$> ./brackets '(johndoe)' | cat -e
|
||||
OK$
|
||||
$> ./brackets '([)]' | cat -e
|
||||
Error$
|
||||
$> ./brackets '' '{[(0 + 0)(1 + 1)](3*(-1)){()}}' | cat -e
|
||||
OK$
|
||||
OK$
|
||||
$> ./brackets | cat -e
|
||||
$
|
||||
$>
|
||||
32
exam-basedir07/subjects/brackets/subject.fr.txt
Normal file
32
exam-basedir07/subjects/brackets/subject.fr.txt
Normal file
@@ -0,0 +1,32 @@
|
||||
Assignment name : brackets
|
||||
Expected files : *.c *.h
|
||||
Allowed functions: write
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
Ecrire un programme qui prendra une chaine de caractères en paramètre et qui
|
||||
écrit sur la sortie standard 'OK' si l'expression est bien parenthesée et
|
||||
'Error' dans le cas contraire, le tout suivi d'une newline.
|
||||
|
||||
Les symboles utilisés comme 'parenthèses' seront les parenthèses '(' et ')', les
|
||||
crochets '[' et ']' ainsi que les accolades '{' et '}'. Tous les autres
|
||||
caractères seront tout simplement ignorés.
|
||||
|
||||
Une parenthèse ouvrante devra obligatoirement être fermée par une parenthèse
|
||||
fermante et dans le bon ordre (parenthèses imbriquées). Une chaine ne comportant
|
||||
aucune parenthèse est considerée comme bien parenthesée.
|
||||
|
||||
Votre programme évaluera tous les arguments. Si aucun argument n'est fourni,
|
||||
il affichera seulement une newline.
|
||||
|
||||
Exemples :
|
||||
|
||||
$> ./brackets '(jo:qahndoe)' | cat -e
|
||||
OK$
|
||||
$> ./brackets '([)]' | cat -e
|
||||
Error$
|
||||
$> ./brackets '' '{[(0 + 0)(1 + 1)](3*(-1)){()}}' | cat -e
|
||||
OK$
|
||||
OK$
|
||||
$> ./brackets | cat -e
|
||||
$
|
||||
$>
|
||||
39
exam-basedir07/subjects/check_mate/examples.txt
Normal file
39
exam-basedir07/subjects/check_mate/examples.txt
Normal file
@@ -0,0 +1,39 @@
|
||||
Pion / Pawn (P):
|
||||
|
||||
. . . . . . .
|
||||
. . . . . . .
|
||||
. . X . X . .
|
||||
. . . P . . .
|
||||
. . . . . . .
|
||||
. . . . . . .
|
||||
. . . . . . .
|
||||
|
||||
Fou / Bishop (B):
|
||||
|
||||
X . . . . . X
|
||||
. X . . . X .
|
||||
. . X . X . .
|
||||
. . . B . . .
|
||||
. . X . X . .
|
||||
. X . . . X .
|
||||
X . . . . . X
|
||||
|
||||
Tour / Rook (R):
|
||||
|
||||
. . . X . . .
|
||||
. . . X . . .
|
||||
. . . X . . .
|
||||
X X X R X X X
|
||||
. . . X . . .
|
||||
. . . X . . .
|
||||
. . . X . . .
|
||||
|
||||
Dame / Queen (Q)
|
||||
|
||||
X . . X . . X
|
||||
. X . X . X .
|
||||
. . X X X . .
|
||||
X X X Q X X X
|
||||
. . X X X . .
|
||||
. X . X . X .
|
||||
X . . X . . X
|
||||
40
exam-basedir07/subjects/check_mate/subject.en.txt
Normal file
40
exam-basedir07/subjects/check_mate/subject.en.txt
Normal file
@@ -0,0 +1,40 @@
|
||||
Assignment name : check_mate
|
||||
Expected files : *.c, *.h
|
||||
Allowed functions: write, malloc, free
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
Write a program who takes rows of a chessboard in argument and check if your
|
||||
King is in a check position.
|
||||
|
||||
Chess is played on a chessboard, a squared board of 8-squares length with
|
||||
specific pieces on it : King, Queen, Bishop, Knight, Rook and Pawns.
|
||||
For this exercice, you will only play with Pawns, Bishops, Rooks and Queen...
|
||||
and obviously a King.
|
||||
|
||||
Each piece have a specific method of movement, and all patterns of capture are
|
||||
detailled in the examples.txt file.
|
||||
|
||||
A piece can capture only the first ennemy piece it founds on its capture
|
||||
patterns.
|
||||
|
||||
The board have a variable size but will remains a square. There's only one King
|
||||
and all other pieces are against it. All other characters except those used for
|
||||
pieces are considered as empty squares.
|
||||
|
||||
The King is considered as in a check position when an other enemy piece can
|
||||
capture it. When it's the case, you will print "Success" on the standard output
|
||||
followed by a newline, otherwise you will print "Fail" followed by a newline.
|
||||
|
||||
If there is no arguments, the program will only print a newline.
|
||||
|
||||
Examples:
|
||||
|
||||
$> ./chessmate '..' '.K' | cat -e
|
||||
Fail$
|
||||
$> ./check_mate 'R...' '.K..' '..P.' '....' | cat -e
|
||||
Success$
|
||||
$> ./chessmate 'R...' 'iheK' '....' 'jeiR' | cat -e
|
||||
Success$
|
||||
$> ./chessmate | cat -e
|
||||
$
|
||||
$>
|
||||
40
exam-basedir07/subjects/check_mate/subject.fr.txt
Normal file
40
exam-basedir07/subjects/check_mate/subject.fr.txt
Normal file
@@ -0,0 +1,40 @@
|
||||
Assignment name : check_mate
|
||||
Expected files : *.c, *.h
|
||||
Allowed functions: write, malloc, free
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
Ecrire un programme qui prendra en arguments les lignes d'un plateau de jeu
|
||||
d'échecs, et verifie si le Roi est en échec ou non par rapport aux autres
|
||||
pièces en jeu.
|
||||
|
||||
Pour rappel, un jeu d'échecs est composé d'un plateau carré de 8 cases de coté
|
||||
et est composé de pièces spécifiques: Roi, Reine, Fou, Cavalier, Tour et Pion.
|
||||
Pour cet exercice, nous ne garderons que les Pions, Fous, Tours et Dames, en
|
||||
plus du Roi.
|
||||
|
||||
Chaque pièce peut se déplacer que selon un schéma précis et les patterns de
|
||||
captures sont détaillés dans l'exemple fourni.
|
||||
|
||||
Une piece ne peut capturer que la premiere piece possible sur leur trajectoire
|
||||
de capture.
|
||||
|
||||
Le plateau peut être de taille différente que le plateau classique, mais sera
|
||||
TOUJOURS carré. Il ne peut y avoir qu'un seul Roi et toutes les autres
|
||||
pièces seront contre lui. Tout autre caractere hormis ceux utilises pour les
|
||||
pieces d'echec sera considere comme une case vide.
|
||||
|
||||
Le roi est considéré comme en échec si une pièce adverse est en position pour
|
||||
le capturer. Si il est en échec, vous devrez afficher "Success" suivi d'une new-
|
||||
line, sinon il affichera "Fail" suivi d'une newline.
|
||||
|
||||
Si aucun argument n'est fourni, le programme affichera une newline.
|
||||
|
||||
Exemples:
|
||||
|
||||
$> ./check_mate '..' '.K' | cat -e
|
||||
Fail$
|
||||
$> ./check_mate 'R...' '.K..' '..P.' '....' | cat -e
|
||||
Success$
|
||||
$> ./check_mate | cat -e
|
||||
$
|
||||
$>
|
||||
28
exam-basedir07/subjects/cycle_detector/subject.en.txt
Normal file
28
exam-basedir07/subjects/cycle_detector/subject.en.txt
Normal file
@@ -0,0 +1,28 @@
|
||||
Assignment name : cycle_detector
|
||||
Expected files : cycle_detector.c
|
||||
Allowed functions: malloc, free
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
Create a function named cycle_detector that takes a const t_list *list
|
||||
as argument, and check if the given linked list contains no cycles.
|
||||
|
||||
A cycle is defined when you go at least twice through the same link, when you
|
||||
travel inside a linked list.
|
||||
|
||||
This function should returnw 1 if it detects a cycle inside the given linked
|
||||
list, otherwise it returns 0.
|
||||
|
||||
This function should be prototyped like this:
|
||||
|
||||
int cycle_detector(const t_list *list)
|
||||
|
||||
The type t_list is:
|
||||
|
||||
typedef struct s_list
|
||||
{
|
||||
int data;
|
||||
struct s_list *next;
|
||||
} t_list;
|
||||
|
||||
This type will be included in a header named "list.h". You don't have to turn-in
|
||||
your "list.h", we will use ours during the evaluation.
|
||||
28
exam-basedir07/subjects/cycle_detector/subject.fr.txt
Normal file
28
exam-basedir07/subjects/cycle_detector/subject.fr.txt
Normal file
@@ -0,0 +1,28 @@
|
||||
Assignment name : cycle_detector
|
||||
Expected files : cycle_detector.c
|
||||
Allowed functions: malloc, free
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
Créez une fonction cycle_detector qui prends un "const t_list *list" en
|
||||
argument, qui vérifiera qu'il n'y a aucun cycle à l'intérieur de la liste chainée
|
||||
list.
|
||||
|
||||
Un cycle est défini quand, lors du parcours de la liste, vous passez au moins 2
|
||||
fois à travers le même maillon.
|
||||
|
||||
Cette fonction retournera 1 si la fonction détecte un cycle, sinon elle renverra 0.
|
||||
|
||||
Cette fonction sera prototypé comme suit :
|
||||
|
||||
int cycle_detector(const t_list *list)
|
||||
|
||||
Le type "t_list" est défini comme suit :
|
||||
|
||||
typedef struct s_list
|
||||
{
|
||||
int data;
|
||||
struct s_list *next;
|
||||
} t_list;
|
||||
|
||||
Ce type sera fourni dans le header "list.h". Vous n'avez pas besoin de le fournir,
|
||||
nous utiliserons le notre en correction.
|
||||
Reference in New Issue
Block a user