Skip to content
Snippets Groups Projects
Commit e03aa324 authored by Sabrina L's avatar Sabrina L
Browse files

Initial commit

parents
No related branches found
No related tags found
No related merge requests found
Showing with 527 additions and 0 deletions
{
"configurations": [
{
"name": "linux-gcc-x64",
"includePath": [
"${workspaceFolder}/**"
],
"compilerPath": "/usr/bin/gcc",
"cStandard": "${default}",
"cppStandard": "${default}",
"intelliSenseMode": "linux-gcc-x64",
"compilerArgs": [
""
]
}
],
"version": 4
}
\ No newline at end of file
{
"version": "0.2.0",
"configurations": [
{
"name": "C/C++ Runner: Debug Session",
"type": "cppdbg",
"request": "launch",
"args": [],
"stopAtEntry": false,
"externalConsole": false,
"cwd": "/home/sabrina/Documents/C/2e_1ere/TP_Puissance4/src",
"program": "/home/sabrina/Documents/C/2e_1ere/TP_Puissance4/src/build/Debug/outDebug",
"MIMode": "gdb",
"miDebuggerPath": "gdb",
"setupCommands": [
{
"description": "Enable pretty-printing for gdb",
"text": "-enable-pretty-printing",
"ignoreFailures": true
}
]
}
]
}
\ No newline at end of file
{
"C_Cpp_Runner.cCompilerPath": "gcc",
"C_Cpp_Runner.cppCompilerPath": "g++",
"C_Cpp_Runner.debuggerPath": "gdb",
"C_Cpp_Runner.cStandard": "",
"C_Cpp_Runner.cppStandard": "",
"C_Cpp_Runner.msvcBatchPath": "",
"C_Cpp_Runner.useMsvc": false,
"C_Cpp_Runner.warnings": [
"-Wall",
"-Wextra",
"-Wpedantic",
"-Wshadow",
"-Wformat=2",
"-Wcast-align",
"-Wconversion",
"-Wsign-conversion",
"-Wnull-dereference"
],
"C_Cpp_Runner.msvcWarnings": [
"/W4",
"/permissive-",
"/w14242",
"/w14287",
"/w14296",
"/w14311",
"/w14826",
"/w44062",
"/w44242",
"/w14905",
"/w14906",
"/w14263",
"/w44265",
"/w14928"
],
"C_Cpp_Runner.enableWarnings": true,
"C_Cpp_Runner.warningsAsError": false,
"C_Cpp_Runner.compilerArgs": [],
"C_Cpp_Runner.linkerArgs": [],
"C_Cpp_Runner.includePaths": [],
"C_Cpp_Runner.includeSearch": [
"*",
"**/*"
],
"C_Cpp_Runner.excludeSearch": [
"**/build",
"**/build/**",
"**/.*",
"**/.*/**",
"**/.vscode",
"**/.vscode/**"
],
"C_Cpp_Runner.useAddressSanitizer": false,
"C_Cpp_Runner.useUndefinedSanitizer": false,
"C_Cpp_Runner.useLeakSanitizer": false,
"C_Cpp_Runner.showCompilationTime": false,
"C_Cpp_Runner.useLinkTimeOptimization": false,
"C_Cpp_Runner.msvcSecureNoWarnings": false
}
\ No newline at end of file
Makefile 0 → 100644
puissance4:
@echo "first rule which must create the puissance4 executable"
clean:
@echo "this rule must clean everything up (including candidate files in testbed)"
$(MAKE) -C testbed clean
tests: puissance4
$(MAKE) -C testbed
\ No newline at end of file
File added
#include "board.h"
void init(){
}
\ No newline at end of file
#include <stdio.h>
#include <stdlib.h>
enum state{Croix, Cercle, Vide};
struct board{
enum state **data;
int col;
int line;
};
void init(int col, int line);
\ No newline at end of file
#include "twoPlayers.h"
void print_game(){
}
void play(){
}
bool winner(){
}
#include <stdio.h>
#include <stdlib.h>
#include <stdbool.h>
void print_game();
void play();
bool winner();
include ../common.mk
EXE=../../puissance4 3 6 7
title:
@echo "=============[2 player tests]============="
Board size is 6x7 (rows x col)
┌─┬─┬─┬─┬─┬─┬─┐
│ │ │ │ │ │ │ │
├─┼─┼─┼─┼─┼─┼─┤
│ │ │ │ │ │ │ │
├─┼─┼─┼─┼─┼─┼─┤
│ │ │ │ │ │ │ │
├─┼─┼─┼─┼─┼─┼─┤
│ │ │ │ │ │ │ │
├─┼─┼─┼─┼─┼─┼─┤
│ │ │ │ │ │ │ │
├─┼─┼─┼─┼─┼─┼─┤
│ │ │ │ │ │ │ │
└─┴─┴─┴─┴─┴─┴─┘
1 2 3 4 5 6 7
Column number? (starts at 1):
┌─┬─┬─┬─┬─┬─┬─┐
│ │ │ │ │ │ │ │
├─┼─┼─┼─┼─┼─┼─┤
│ │ │ │ │ │ │ │
├─┼─┼─┼─┼─┼─┼─┤
│ │ │ │ │ │ │ │
├─┼─┼─┼─┼─┼─┼─┤
│ │ │ │ │ │ │ │
├─┼─┼─┼─┼─┼─┼─┤
│ │ │ │ │ │ │ │
├─┼─┼─┼─┼─┼─┼─┤
│ │ │ │X│ │ │ │
└─┴─┴─┴─┴─┴─┴─┘
1 2 3 4 5 6 7
Column number? (starts at 1):
┌─┬─┬─┬─┬─┬─┬─┐
│ │ │ │ │ │ │ │
├─┼─┼─┼─┼─┼─┼─┤
│ │ │ │ │ │ │ │
├─┼─┼─┼─┼─┼─┼─┤
│ │ │ │ │ │ │ │
├─┼─┼─┼─┼─┼─┼─┤
│ │ │ │ │ │ │ │
├─┼─┼─┼─┼─┼─┼─┤
│ │ │ │ │ │ │ │
├─┼─┼─┼─┼─┼─┼─┤
│O│ │ │X│ │ │ │
└─┴─┴─┴─┴─┴─┴─┘
1 2 3 4 5 6 7
Column number? (starts at 1):
┌─┬─┬─┬─┬─┬─┬─┐
│ │ │ │ │ │ │ │
├─┼─┼─┼─┼─┼─┼─┤
│ │ │ │ │ │ │ │
├─┼─┼─┼─┼─┼─┼─┤
│ │ │ │ │ │ │ │
├─┼─┼─┼─┼─┼─┼─┤
│ │ │ │ │ │ │ │
├─┼─┼─┼─┼─┼─┼─┤
│ │ │ │X│ │ │ │
├─┼─┼─┼─┼─┼─┼─┤
│O│ │ │X│ │ │ │
└─┴─┴─┴─┴─┴─┴─┘
1 2 3 4 5 6 7
Column number? (starts at 1):
┌─┬─┬─┬─┬─┬─┬─┐
│ │ │ │ │ │ │ │
├─┼─┼─┼─┼─┼─┼─┤
│ │ │ │ │ │ │ │
├─┼─┼─┼─┼─┼─┼─┤
│ │ │ │ │ │ │ │
├─┼─┼─┼─┼─┼─┼─┤
│ │ │ │ │ │ │ │
├─┼─┼─┼─┼─┼─┼─┤
│O│ │ │X│ │ │ │
├─┼─┼─┼─┼─┼─┼─┤
│O│ │ │X│ │ │ │
└─┴─┴─┴─┴─┴─┴─┘
1 2 3 4 5 6 7
Column number? (starts at 1):
┌─┬─┬─┬─┬─┬─┬─┐
│ │ │ │ │ │ │ │
├─┼─┼─┼─┼─┼─┼─┤
│ │ │ │ │ │ │ │
├─┼─┼─┼─┼─┼─┼─┤
│ │ │ │ │ │ │ │
├─┼─┼─┼─┼─┼─┼─┤
│ │ │ │X│ │ │ │
├─┼─┼─┼─┼─┼─┼─┤
│O│ │ │X│ │ │ │
├─┼─┼─┼─┼─┼─┼─┤
│O│ │ │X│ │ │ │
└─┴─┴─┴─┴─┴─┴─┘
1 2 3 4 5 6 7
Column number? (starts at 1):
┌─┬─┬─┬─┬─┬─┬─┐
│ │ │ │ │ │ │ │
├─┼─┼─┼─┼─┼─┼─┤
│ │ │ │ │ │ │ │
├─┼─┼─┼─┼─┼─┼─┤
│ │ │ │ │ │ │ │
├─┼─┼─┼─┼─┼─┼─┤
│O│ │ │X│ │ │ │
├─┼─┼─┼─┼─┼─┼─┤
│O│ │ │X│ │ │ │
├─┼─┼─┼─┼─┼─┼─┤
│O│ │ │X│ │ │ │
└─┴─┴─┴─┴─┴─┴─┘
1 2 3 4 5 6 7
Column number? (starts at 1):
┌─┬─┬─┬─┬─┬─┬─┐
│ │ │ │ │ │ │ │
├─┼─┼─┼─┼─┼─┼─┤
│ │ │ │ │ │ │ │
├─┼─┼─┼─┼─┼─┼─┤
│ │ │ │X│ │ │ │
├─┼─┼─┼─┼─┼─┼─┤
│O│ │ │X│ │ │ │
├─┼─┼─┼─┼─┼─┼─┤
│O│ │ │X│ │ │ │
├─┼─┼─┼─┼─┼─┼─┤
│O│ │ │X│ │ │ │
└─┴─┴─┴─┴─┴─┴─┘
1 2 3 4 5 6 7
Player one won!
4 1 4 1 4 1 4
Board size is 6x7 (rows x col)
┌─┬─┬─┬─┬─┬─┬─┐
│ │ │ │ │ │ │ │
├─┼─┼─┼─┼─┼─┼─┤
│ │ │ │ │ │ │ │
├─┼─┼─┼─┼─┼─┼─┤
│ │ │ │ │ │ │ │
├─┼─┼─┼─┼─┼─┼─┤
│ │ │ │ │ │ │ │
├─┼─┼─┼─┼─┼─┼─┤
│ │ │ │ │ │ │ │
├─┼─┼─┼─┼─┼─┼─┤
│ │ │ │ │ │ │ │
└─┴─┴─┴─┴─┴─┴─┘
1 2 3 4 5 6 7
Column number? (starts at 1):
┌─┬─┬─┬─┬─┬─┬─┐
│ │ │ │ │ │ │ │
├─┼─┼─┼─┼─┼─┼─┤
│ │ │ │ │ │ │ │
├─┼─┼─┼─┼─┼─┼─┤
│ │ │ │ │ │ │ │
├─┼─┼─┼─┼─┼─┼─┤
│ │ │ │ │ │ │ │
├─┼─┼─┼─┼─┼─┼─┤
│ │ │ │ │ │ │ │
├─┼─┼─┼─┼─┼─┼─┤
│ │ │ │X│ │ │ │
└─┴─┴─┴─┴─┴─┴─┘
1 2 3 4 5 6 7
Column number? (starts at 1):
┌─┬─┬─┬─┬─┬─┬─┐
│ │ │ │ │ │ │ │
├─┼─┼─┼─┼─┼─┼─┤
│ │ │ │ │ │ │ │
├─┼─┼─┼─┼─┼─┼─┤
│ │ │ │ │ │ │ │
├─┼─┼─┼─┼─┼─┼─┤
│ │ │ │ │ │ │ │
├─┼─┼─┼─┼─┼─┼─┤
│ │ │ │ │ │ │ │
├─┼─┼─┼─┼─┼─┼─┤
│O│ │ │X│ │ │ │
└─┴─┴─┴─┴─┴─┴─┘
1 2 3 4 5 6 7
Column number? (starts at 1):
┌─┬─┬─┬─┬─┬─┬─┐
│ │ │ │ │ │ │ │
├─┼─┼─┼─┼─┼─┼─┤
│ │ │ │ │ │ │ │
├─┼─┼─┼─┼─┼─┼─┤
│ │ │ │ │ │ │ │
├─┼─┼─┼─┼─┼─┼─┤
│ │ │ │ │ │ │ │
├─┼─┼─┼─┼─┼─┼─┤
│ │ │ │X│ │ │ │
├─┼─┼─┼─┼─┼─┼─┤
│O│ │ │X│ │ │ │
└─┴─┴─┴─┴─┴─┴─┘
1 2 3 4 5 6 7
Column number? (starts at 1):
┌─┬─┬─┬─┬─┬─┬─┐
│ │ │ │ │ │ │ │
├─┼─┼─┼─┼─┼─┼─┤
│ │ │ │ │ │ │ │
├─┼─┼─┼─┼─┼─┼─┤
│ │ │ │ │ │ │ │
├─┼─┼─┼─┼─┼─┼─┤
│ │ │ │ │ │ │ │
├─┼─┼─┼─┼─┼─┼─┤
│O│ │ │X│ │ │ │
├─┼─┼─┼─┼─┼─┼─┤
│O│ │ │X│ │ │ │
└─┴─┴─┴─┴─┴─┴─┘
1 2 3 4 5 6 7
Column number? (starts at 1):
┌─┬─┬─┬─┬─┬─┬─┐
│ │ │ │ │ │ │ │
├─┼─┼─┼─┼─┼─┼─┤
│ │ │ │ │ │ │ │
├─┼─┼─┼─┼─┼─┼─┤
│ │ │ │ │ │ │ │
├─┼─┼─┼─┼─┼─┼─┤
│ │ │ │X│ │ │ │
├─┼─┼─┼─┼─┼─┼─┤
│O│ │ │X│ │ │ │
├─┼─┼─┼─┼─┼─┼─┤
│O│ │ │X│ │ │ │
└─┴─┴─┴─┴─┴─┴─┘
1 2 3 4 5 6 7
Column number? (starts at 1):
┌─┬─┬─┬─┬─┬─┬─┐
│ │ │ │ │ │ │ │
├─┼─┼─┼─┼─┼─┼─┤
│ │ │ │ │ │ │ │
├─┼─┼─┼─┼─┼─┼─┤
│ │ │ │ │ │ │ │
├─┼─┼─┼─┼─┼─┼─┤
│O│ │ │X│ │ │ │
├─┼─┼─┼─┼─┼─┼─┤
│O│ │ │X│ │ │ │
├─┼─┼─┼─┼─┼─┼─┤
│O│ │ │X│ │ │ │
└─┴─┴─┴─┴─┴─┴─┘
1 2 3 4 5 6 7
Column number? (starts at 1):
┌─┬─┬─┬─┬─┬─┬─┐
│ │ │ │ │ │ │ │
├─┼─┼─┼─┼─┼─┼─┤
│ │ │ │ │ │ │ │
├─┼─┼─┼─┼─┼─┼─┤
│ │ │ │X│ │ │ │
├─┼─┼─┼─┼─┼─┼─┤
│O│ │ │X│ │ │ │
├─┼─┼─┼─┼─┼─┼─┤
│O│ │ │X│ │ │ │
├─┼─┼─┼─┼─┼─┼─┤
│O│ │ │X│ │ │ │
└─┴─┴─┴─┴─┴─┴─┘
1 2 3 4 5 6 7
Player one won!
Board size is 6x7 (rows x col)
┌─┬─┬─┬─┬─┬─┬─┐
│ │ │ │ │ │ │ │
├─┼─┼─┼─┼─┼─┼─┤
│ │ │ │ │ │ │ │
├─┼─┼─┼─┼─┼─┼─┤
│ │ │ │ │ │ │ │
├─┼─┼─┼─┼─┼─┼─┤
│ │ │ │ │ │ │ │
├─┼─┼─┼─┼─┼─┼─┤
│ │ │ │ │ │ │ │
├─┼─┼─┼─┼─┼─┼─┤
│ │ │ │ │ │ │ │
└─┴─┴─┴─┴─┴─┴─┘
1 2 3 4 5 6 7
Column number? (starts at 1):
┌─┬─┬─┬─┬─┬─┬─┐
│ │ │ │ │ │ │ │
├─┼─┼─┼─┼─┼─┼─┤
│ │ │ │ │ │ │ │
├─┼─┼─┼─┼─┼─┼─┤
│ │ │ │ │ │ │ │
├─┼─┼─┼─┼─┼─┼─┤
│ │ │ │ │ │ │ │
├─┼─┼─┼─┼─┼─┼─┤
│ │ │ │ │ │ │ │
├─┼─┼─┼─┼─┼─┼─┤
│X│ │ │ │ │ │ │
└─┴─┴─┴─┴─┴─┴─┘
1 2 3 4 5 6 7
Column number? (starts at 1):
┌─┬─┬─┬─┬─┬─┬─┐
│ │ │ │ │ │ │ │
├─┼─┼─┼─┼─┼─┼─┤
│ │ │ │ │ │ │ │
├─┼─┼─┼─┼─┼─┼─┤
│ │ │ │ │ │ │ │
├─┼─┼─┼─┼─┼─┼─┤
│ │ │ │ │ │ │ │
├─┼─┼─┼─┼─┼─┼─┤
│O│ │ │ │ │ │ │
├─┼─┼─┼─┼─┼─┼─┤
│X│ │ │ │ │ │ │
└─┴─┴─┴─┴─┴─┴─┘
1 2 3 4 5 6 7
Column number? (starts at 1):
┌─┬─┬─┬─┬─┬─┬─┐
│ │ │ │ │ │ │ │
├─┼─┼─┼─┼─┼─┼─┤
│ │ │ │ │ │ │ │
├─┼─┼─┼─┼─┼─┼─┤
│ │ │ │ │ │ │ │
├─┼─┼─┼─┼─┼─┼─┤
│ │ │ │ │ │ │ │
├─┼─┼─┼─┼─┼─┼─┤
│O│ │ │ │ │ │ │
├─┼─┼─┼─┼─┼─┼─┤
│X│X│ │ │ │ │ │
└─┴─┴─┴─┴─┴─┴─┘
1 2 3 4 5 6 7
Column number? (starts at 1):
┌─┬─┬─┬─┬─┬─┬─┐
│ │ │ │ │ │ │ │
├─┼─┼─┼─┼─┼─┼─┤
│ │ │ │ │ │ │ │
├─┼─┼─┼─┼─┼─┼─┤
│ │ │ │ │ │ │ │
├─┼─┼─┼─┼─┼─┼─┤
│ │ │ │ │ │ │ │
├─┼─┼─┼─┼─┼─┼─┤
│O│O│ │ │ │ │ │
├─┼─┼─┼─┼─┼─┼─┤
│X│X│ │ │ │ │ │
└─┴─┴─┴─┴─┴─┴─┘
1 2 3 4 5 6 7
Column number? (starts at 1):
┌─┬─┬─┬─┬─┬─┬─┐
│ │ │ │ │ │ │ │
├─┼─┼─┼─┼─┼─┼─┤
│ │ │ │ │ │ │ │
├─┼─┼─┼─┼─┼─┼─┤
│ │ │ │ │ │ │ │
├─┼─┼─┼─┼─┼─┼─┤
│ │ │ │ │ │ │ │
├─┼─┼─┼─┼─┼─┼─┤
│O│O│ │ │ │ │ │
├─┼─┼─┼─┼─┼─┼─┤
│X│X│X│ │ │ │ │
└─┴─┴─┴─┴─┴─┴─┘
1 2 3 4 5 6 7
Column number? (starts at 1):
┌─┬─┬─┬─┬─┬─┬─┐
│ │ │ │ │ │ │ │
├─┼─┼─┼─┼─┼─┼─┤
│ │ │ │ │ │ │ │
├─┼─┼─┼─┼─┼─┼─┤
│ │ │ │ │ │ │ │
├─┼─┼─┼─┼─┼─┼─┤
│ │ │ │ │ │ │ │
├─┼─┼─┼─┼─┼─┼─┤
│O│O│O│ │ │ │ │
├─┼─┼─┼─┼─┼─┼─┤
│X│X│X│ │ │ │ │
└─┴─┴─┴─┴─┴─┴─┘
1 2 3 4 5 6 7
Column number? (starts at 1):
┌─┬─┬─┬─┬─┬─┬─┐
│ │ │ │ │ │ │ │
├─┼─┼─┼─┼─┼─┼─┤
│ │ │ │ │ │ │ │
├─┼─┼─┼─┼─┼─┼─┤
│ │ │ │ │ │ │ │
├─┼─┼─┼─┼─┼─┼─┤
│ │ │ │ │ │ │ │
├─┼─┼─┼─┼─┼─┼─┤
│O│O│O│ │ │ │ │
├─┼─┼─┼─┼─┼─┼─┤
│X│X│X│X│ │ │ │
└─┴─┴─┴─┴─┴─┴─┘
1 2 3 4 5 6 7
Player one won!
1 1 2 2 3 3 4
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment