pull/78/head
Pierre Ferreira 1 year ago
commit ee90a9f501

Binary file not shown.

After

Width:  |  Height:  |  Size: 13 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 254 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 26 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

@ -19,6 +19,7 @@
"bootstrap": "^5.3.2", "bootstrap": "^5.3.2",
"cors": "^2.8.5", "cors": "^2.8.5",
"express": "^4.18.2", "express": "^4.18.2",
"file-saver": "^2.0.5",
"lodash": "^4.17.21", "lodash": "^4.17.21",
"react": "^18.2.0", "react": "^18.2.0",
"react-bootstrap": "^2.9.1", "react-bootstrap": "^2.9.1",
@ -37,6 +38,7 @@
"web-vitals": "^2.1.4" "web-vitals": "^2.1.4"
}, },
"devDependencies": { "devDependencies": {
"@types/file-saver": "^2.0.7",
"@types/react-router-hash-link": "^2.4.9", "@types/react-router-hash-link": "^2.4.9",
"@types/uuid": "^9.0.7" "@types/uuid": "^9.0.7"
} }
@ -4277,6 +4279,12 @@
"@types/send": "*" "@types/send": "*"
} }
}, },
"node_modules/@types/file-saver": {
"version": "2.0.7",
"resolved": "https://registry.npmjs.org/@types/file-saver/-/file-saver-2.0.7.tgz",
"integrity": "sha512-dNKVfHd/jk0SkR/exKGj2ggkB45MAkzvWCaqLUUgkyjITkGNzH8H+yUwr+BLJUBjZOe9w8X3wgmXhZDRg1ED6A==",
"dev": true
},
"node_modules/@types/graceful-fs": { "node_modules/@types/graceful-fs": {
"version": "4.1.9", "version": "4.1.9",
"resolved": "https://registry.npmjs.org/@types/graceful-fs/-/graceful-fs-4.1.9.tgz", "resolved": "https://registry.npmjs.org/@types/graceful-fs/-/graceful-fs-4.1.9.tgz",
@ -8456,6 +8464,11 @@
"webpack": "^4.0.0 || ^5.0.0" "webpack": "^4.0.0 || ^5.0.0"
} }
}, },
"node_modules/file-saver": {
"version": "2.0.5",
"resolved": "https://registry.npmjs.org/file-saver/-/file-saver-2.0.5.tgz",
"integrity": "sha512-P9bmyZ3h/PRG+Nzga+rbdI4OEpNDzAVyy74uVO9ATgzLK6VtAsYybF/+TOCvrc0MO793d6+42lLyZTw7/ArVzA=="
},
"node_modules/filelist": { "node_modules/filelist": {
"version": "1.0.4", "version": "1.0.4",
"resolved": "https://registry.npmjs.org/filelist/-/filelist-1.0.4.tgz", "resolved": "https://registry.npmjs.org/filelist/-/filelist-1.0.4.tgz",

@ -13,6 +13,7 @@
"bootstrap": "^5.3.2", "bootstrap": "^5.3.2",
"cors": "^2.8.5", "cors": "^2.8.5",
"express": "^4.18.2", "express": "^4.18.2",
"file-saver": "^2.0.5",
"lodash": "^4.17.21", "lodash": "^4.17.21",
"react": "^18.2.0", "react": "^18.2.0",
"react-bootstrap": "^2.9.1", "react-bootstrap": "^2.9.1",
@ -55,6 +56,7 @@
] ]
}, },
"devDependencies": { "devDependencies": {
"@types/file-saver": "^2.0.7",
"@types/react-router-hash-link": "^2.4.9", "@types/react-router-hash-link": "^2.4.9",
"@types/uuid": "^9.0.7" "@types/uuid": "^9.0.7"
} }

@ -22,6 +22,7 @@ interface MyGraphComponentProps {
changecptTour: (newcptTour : number) => void changecptTour: (newcptTour : number) => void
addToHistory: (message : string) => void addToHistory: (message : string) => void
solo : boolean solo : boolean
setNetwork: (network: Network) => void
showLast: boolean showLast: boolean
} }
@ -41,7 +42,7 @@ let cptHistory = 0
let lastNodes: NodePerson[] = [] let lastNodes: NodePerson[] = []
const MyGraphComponent: React.FC<MyGraphComponentProps> = ({onNodeClick, handleShowTurnBar, handleTurnBarTextChange, playerTouched, setPlayerTouched, changecptTour, solo, addToHistory, showLast}) => { const MyGraphComponent: React.FC<MyGraphComponentProps> = ({onNodeClick, handleShowTurnBar, handleTurnBarTextChange, playerTouched, setPlayerTouched, changecptTour, solo, addToHistory, showLast, setNetwork}) => {
let cptTour: number = 0 let cptTour: number = 0
const { indices, indice, person, personNetwork, setNodeIdData, players, askedPersons, setActualPlayerIndexData, room, actualPlayerIndex, turnPlayerIndex, setTurnPlayerIndexData, setWinnerData } = useGame(); const { indices, indice, person, personNetwork, setNodeIdData, players, askedPersons, setActualPlayerIndexData, room, actualPlayerIndex, turnPlayerIndex, setTurnPlayerIndexData, setWinnerData } = useGame();
@ -255,6 +256,8 @@ let cptTour: number = 0
const networkData = { nodes: nodes, edges: graph.edges }; const networkData = { nodes: nodes, edges: graph.edges };
const network = new Network(container, networkData, initialOptions); const network = new Network(container, networkData, initialOptions);
setNetwork(network)
if (!solo){ if (!solo){
socket.on("asked all", (id) =>{ socket.on("asked all", (id) =>{
const pers = personNetwork.getPersons().find((p) => p.getId() == id) const pers = personNetwork.getPersons().find((p) => p.getId() == id)
@ -476,6 +479,7 @@ let cptTour: number = 0
// Un nœud a été cliqué // Un nœud a été cliqué
initialOptions.physics.enabled = false; initialOptions.physics.enabled = false;
network.setOptions(initialOptions); network.setOptions(initialOptions);
setNetwork(network)
} }
}); });

@ -1,5 +1,6 @@
import React, { useState, useEffect } from 'react'; import React, { useState, useEffect } from 'react';
import Switch from "react-switch"; import Switch from "react-switch";
import {saveAs} from "file-saver"
/* Style */ /* Style */
import "./InGame.css" import "./InGame.css"
@ -42,6 +43,8 @@ import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
import { NavLink } from 'react-router-dom'; import { NavLink } from 'react-router-dom';
import { last } from 'lodash'; import { last } from 'lodash';
import { socket } from '../SocketConfig'; import { socket } from '../SocketConfig';
import { Network } from 'vis-network';
import generateLatexCode from '../Script/LatexScript';
//@ts-ignore //@ts-ignore
const InGame = ({locale, changeLocale}) => { const InGame = ({locale, changeLocale}) => {
@ -79,11 +82,20 @@ const InGame = ({locale, changeLocale}) => {
} }
}, [history]); }, [history]);
const {personNetwork, person, indices} = useGame()
const [showChoiceBar, setShowChoiceBar] = useState(false); const [showChoiceBar, setShowChoiceBar] = useState(false);
const [showTurnBar, setShowTurnBar] = useState(false); const [showTurnBar, setShowTurnBar] = useState(false);
const [turnBarText, setTurnBarText] = useState(""); const [turnBarText, setTurnBarText] = useState("");
const [playerTouched, setPlayerTouched] = useState(-2) const [playerTouched, setPlayerTouched] = useState(-2)
const [network, setNetwork] = useState<Network | null>(null)
const setNetworkData = (network: Network) => {
setNetwork(network)
}
const handleNodeClick = (shouldShowChoiceBar: boolean) => { const handleNodeClick = (shouldShowChoiceBar: boolean) => {
setShowChoiceBar(shouldShowChoiceBar); setShowChoiceBar(shouldShowChoiceBar);
}; };
@ -101,6 +113,16 @@ const InGame = ({locale, changeLocale}) => {
setTurnBarText(newTurnBarText) setTurnBarText(newTurnBarText)
} }
const generateTEX = () => {
if (network != null && personNetwork != null && person != null){
const tex = generateLatexCode(personNetwork, person, indices, network)
const blob = new Blob([tex], { type: 'application/x-latex;charset=utf-8' });
// Utiliser FileSaver pour télécharger le fichier
saveAs(blob, 'socialGraph.tex');
}
}
const resetGraph = () => { const resetGraph = () => {
setisLoading(true); setisLoading(true);
socket.emit("reset graph", socket.id) socket.emit("reset graph", socket.id)
@ -175,7 +197,7 @@ const InGame = ({locale, changeLocale}) => {
}; };
const [SwitchEnabled, setSwitchEnabled] = useState(false) const [SwitchEnabled, setSwitchEnabled] = useState(false)
const indices = Stub.GenerateIndice() const allIndices = Stub.GenerateIndice()
const { indice, players } = useGame(); const { indice, players } = useGame();
@ -191,6 +213,7 @@ const InGame = ({locale, changeLocale}) => {
solo={IsSolo} solo={IsSolo}
setPlayerTouched={handleSetPlayerTouched} setPlayerTouched={handleSetPlayerTouched}
playerTouched={playerTouched} playerTouched={playerTouched}
setNetwork={setNetworkData}
showLast={showLast}/> showLast={showLast}/>
</div> </div>
@ -290,6 +313,14 @@ const InGame = ({locale, changeLocale}) => {
}}> }}>
<img src={ eye } alt="indice" height="40"/> <img src={ eye } alt="indice" height="40"/>
</button> </button>
<button className='button' onClick={generateTEX}
style={{
backgroundColor: theme.colors.tertiary,
borderColor: theme.colors.secondary
}}>
<img src={MGlass} alt="indice" height="40"/>
</button>
</div> </div>
{/* {/*

@ -0,0 +1,95 @@
import PersonNetwork from "../model/PersonsNetwork";
import Person from "../model/Person";
import GenerateNetwork from "../model/NetworkGenerator";
import NetworkGenerator from "../model/NetworkGenerator";
import fs from 'fs';
import Stub from "../model/Stub";
import GameCreator from "../model/GameCreator";
import Indice from "../model/Indices/Indice";
import { ColorToString, SportToString } from "../model/EnumExtender";
import GraphCreator from "../model/Graph/GraphCreator";
import { DataSet, Network } from "vis-network";
function generateLatexCode(personsNet : PersonNetwork, choosenPerson : Person, choosenIndices : Indice[], network: Network): string {
let latexCode = "";
//*Setup
latexCode += "\\documentclass[11pt]{article}\n"
latexCode += "\\usepackage{fullpage}\n"
latexCode += "\\usepackage{times}\n"
latexCode += "\\usepackage{tikz}\n"
latexCode += "\\usepackage{paralist}\n"
latexCode += "\\usepackage{geometry}\n"
latexCode += "\\usetikzlibrary {shapes.multipart}\n"
latexCode += "\\geometry{margin=0.5cm}\n"
latexCode += "\\newcommand{\\Basketball}{\\includegraphics[width=.5cm]{ballon-de-basket.png}}\n"
latexCode += "\\newcommand{\\Football}{\\includegraphics[width=.4cm]{ballon-de-foot.png}}\n"
latexCode += "\\newcommand{\\Bowling}{\\includegraphics[width=.5cm]{bowling.png}}\n"
latexCode += "\\newcommand{\\Baseball}{\\includegraphics[width=.5cm]{baseball.png}}\n"
latexCode += "\\newcommand{\\Tennis}{\\includegraphics[width=.5cm]{tennis.png}}\n"
//** Header
latexCode+= "\\begin{document}\n"
latexCode+= "\\thispagestyle{empty}\n"
latexCode+= "Voici le graphe de SocialGraphe\n"
latexCode+= "\\begin{center}\n"
latexCode+= "\\begin{tikzpicture}[scale=.17]\n"
personsNet.getPersons().forEach((person, index) => {
var nodesData = network.getPositions();
// Obtenir les coordonnées du nœud
const nodeId = person.getId().toString();
const position = nodesData[nodeId];
if (position) {
const x = (position.x / 9).toFixed(2); // Arrondir à 2 décimales
const y = (position.y / 9).toFixed(2);
latexCode += ` \\node[draw, circle split, align=center] (${person.getId()}) at (${x},${y}) { ${person.getName()} \\\\ ${person.getAge()} \\nodepart{lower}`;
latexCode += `${ColorToString(person.getColor(), "fr")} \\\\`
person.getSports().forEach((sport) => { latexCode += ` \\${SportToString(sport, 'fr')}{}` });
latexCode += "};\n";
} else {
console.error(`Les coordonnées du nœud ${nodeId} ne sont pas disponibles.`);
}
});
personsNet.getPersons().forEach((person) => {
person.getFriends().forEach((friend) => {
latexCode += ` \\draw (${person.getId()}) -- (${friend.getId()});\n`;
});
console.log(person.getFriends().length);
});
latexCode += "\\end{tikzpicture}\n";
latexCode += "\\end{center}\n";
//* Zone d'énoncé :
latexCode += "\n\n\\paragraph{Première énigme}\n"
latexCode += "Trouver qui est le coupable avec les indices suivants.\n"
latexCode += "\\begin{compactitem}\n"
choosenIndices.forEach((indice, index) => {
latexCode += `\\item Indice ${index + 1} : ${indice.ToString('fr')}.\n`
})
latexCode += "\\end{compactitem}\n"
//* Solution
latexCode += "% Solution : " + choosenPerson.getName() + "\n";
latexCode += "\\end{document}\n"
return latexCode
}
export default generateLatexCode

@ -0,0 +1,131 @@
\documentclass[11pt]{article}
\usepackage{fullpage}
\usepackage{times}
\usepackage{tikz}
\usepackage{paralist}
\usetikzlibrary {shapes.multipart}
\newcommand{\Basketball}{\includegraphics[width=.5cm]{ballon-de-basket.png}}
\newcommand{\Football}{\includegraphics[width=.4cm]{ballon-de-foot.png}}
\newcommand{\Bowling}{\includegraphics[width=.5cm]{bowling.png}}
\newcommand{\Baseball}{\includegraphics[width=.5cm]{baseball.png}}
\newcommand{\Tennis}{\includegraphics[width=.5cm]{tennis.png}}
\begin{document}
\thispagestyle{empty}
Voici le graphe de SocialGraphe
\begin{center}
\begin{tikzpicture}[scale=.17]
\node[draw, circle split] (0) at (17.56,12.89) { Noah \nodepart{lower} \Bowling{}};
\node[draw, circle split] (1) at (10.33,-12.44) { Victoria \nodepart{lower} \Baseball{} \Basketball{}};
\node[draw, circle split] (2) at (47.11,-11.56) { Ava \nodepart{lower} \Tennis{} \Football{}};
\node[draw, circle split] (3) at (42.89,9.67) { Joseph \nodepart{lower} \Tennis{}};
\node[draw, circle split] (4) at (-35.44,-31.89) { Daniel \nodepart{lower} \Basketball{} \Football{} \Bowling{}};
\node[draw, circle split] (5) at (35.44,-45.00) { Violet \nodepart{lower} \Baseball{}};
\node[draw, circle split] (6) at (-14.56,49.78) { Aurora \nodepart{lower} \Bowling{} \Baseball{} \Basketball{}};
\node[draw, circle split] (7) at (-5.44,-4.78) { Stella \nodepart{lower} \Tennis{} \Football{}};
\node[draw, circle split] (8) at (-28.22,-11.44) { Brayden \nodepart{lower} \Football{} \Baseball{}};
\node[draw, circle split] (9) at (-25.56,25.22) { Sophia \nodepart{lower} \Bowling{} \Basketball{}};
\node[draw, circle split] (10) at (-34.67,-52.11) { Aurora \nodepart{lower} \Tennis{}};
\node[draw, circle split] (11) at (-9.22,-58.67) { Grace \nodepart{lower} \Football{} \Bowling{}};
\node[draw, circle split] (12) at (-14.67,-20.56) { William \nodepart{lower} \Baseball{} \Basketball{} \Tennis{}};
\node[draw, circle split] (13) at (-53.22,-11.00) { Connor \nodepart{lower} \Basketball{} \Football{}};
\node[draw, circle split] (14) at (17.33,35.44) { Amelia \nodepart{lower} \Tennis{} \Bowling{}};
\node[draw, circle split] (15) at (45.00,33.33) { Riley \nodepart{lower} \Baseball{}};
\node[draw, circle split] (16) at (-6.00,32.67) { Carter \nodepart{lower} \Tennis{} \Bowling{}};
\node[draw, circle split] (17) at (30.11,32.78) { Nathan \nodepart{lower} \Baseball{} \Basketball{}};
\node[draw, circle split] (18) at (-1.33,-23.89) { Noah \nodepart{lower} \Football{} \Football{}};
\node[draw, circle split] (19) at (25.11,-3.11) { Ryan \nodepart{lower} \Bowling{} \Tennis{}};
\node[draw, circle split] (20) at (-1.33,6.33) { Isabella \nodepart{lower} \Baseball{}};
\node[draw, circle split] (21) at (15.00,-41.78) { Alexander \nodepart{lower} \Basketball{} \Bowling{} \Baseball{}};
\node[draw, circle split] (22) at (2.67,22.56) { Emily \nodepart{lower} \Football{}};
\node[draw, circle split] (23) at (26.33,-22.56) { Matthew \nodepart{lower} \Basketball{} \Tennis{}};
\node[draw, circle split] (24) at (-45.11,8.44) { Aurora \nodepart{lower} \Basketball{}};
\node[draw, circle split] (25) at (-2.00,-44.00) { Mia \nodepart{lower} \Tennis{} \Bowling{} \Baseball{}};
\node[draw, circle split] (26) at (-8.78,11.67) { Liam \nodepart{lower} \Football{}};
\node[draw, circle split] (27) at (-20.89,5.00) { Henry \nodepart{lower} \Basketball{} \Football{}};
\node[draw, circle split] (28) at (-0.56,66.00) { Aiden \nodepart{lower} \Tennis{} \Baseball{}};
\node[draw, circle split] (29) at (-45.67,31.67) { Nora \nodepart{lower} \Bowling{} \Basketball{}};
\draw (0) -- (19);
\draw (0) -- (14);
\draw (0) -- (20);
\draw (0) -- (3);
\draw (0) -- (17);
\draw (1) -- (19);
\draw (1) -- (21);
\draw (1) -- (12);
\draw (1) -- (23);
\draw (2) -- (19);
\draw (2) -- (23);
\draw (3) -- (0);
\draw (3) -- (15);
\draw (4) -- (12);
\draw (4) -- (8);
\draw (5) -- (23);
\draw (6) -- (16);
\draw (6) -- (28);
\draw (7) -- (26);
\draw (7) -- (8);
\draw (7) -- (18);
\draw (8) -- (4);
\draw (8) -- (7);
\draw (8) -- (13);
\draw (8) -- (27);
\draw (9) -- (26);
\draw (9) -- (29);
\draw (9) -- (16);
\draw (10) -- (11);
\draw (11) -- (10);
\draw (11) -- (25);
\draw (12) -- (1);
\draw (12) -- (4);
\draw (13) -- (8);
\draw (14) -- (0);
\draw (14) -- (16);
\draw (15) -- (3);
\draw (16) -- (6);
\draw (16) -- (9);
\draw (16) -- (14);
\draw (16) -- (26);
\draw (17) -- (0);
\draw (18) -- (7);
\draw (18) -- (21);
\draw (18) -- (25);
\draw (18) -- (23);
\draw (19) -- (0);
\draw (19) -- (1);
\draw (19) -- (2);
\draw (20) -- (0);
\draw (20) -- (27);
\draw (20) -- (22);
\draw (21) -- (1);
\draw (21) -- (18);
\draw (22) -- (20);
\draw (23) -- (1);
\draw (23) -- (2);
\draw (23) -- (5);
\draw (23) -- (18);
\draw (24) -- (27);
\draw (24) -- (29);
\draw (25) -- (11);
\draw (25) -- (18);
\draw (26) -- (7);
\draw (26) -- (9);
\draw (26) -- (16);
\draw (27) -- (8);
\draw (27) -- (20);
\draw (27) -- (24);
\draw (28) -- (6);
\draw (29) -- (9);
\draw (29) -- (24);
\end{tikzpicture}
\end{center}
\paragraph{Première énigme}
Trouver qui est le coupable avec les indices suivants.
\begin{compactitem}
\item Indice 1 : Le suspect a ou a plus de 30 ans.
\item Indice 2 : Le suspect a les cheveux Noir ou Roux .
\item Indice 3 : Le suspect 3 amis.
\end{compactitem}
% Solution : Ryan
\end{document}

@ -42,11 +42,11 @@
"and": "and", "and": "and",
"or": "or", "or": "or",
"or_sport": "and/or", "or_sport": "or",
"age_indice_start": "The suspect is between", "age_indice_start": "The suspect is between",
"age_indice_more_start": "The suspect is older than or", "age_indice_more_start": "The suspect is at least",
"age_indice_end": "years old", "age_indice_end": "years old",
"color_edges_start": "The suspect has at least one friend with", "color_edges_start": "The suspect has at least one friend with",

@ -42,10 +42,10 @@
"and": "et", "and": "et",
"or": "ou", "or": "ou",
"or_sport": "et/ou du", "or_sport": "ou du",
"age_indice_start": "Le suspect a entre", "age_indice_start": "Le suspect a entre",
"age_indice_more_start": "Le suspect a ou a plus de", "age_indice_more_start": "Le suspect a au moins",
"age_indice_end": "ans", "age_indice_end": "ans",
"color_edges_start": "Le suspect a au moins un ami avec les cheveux", "color_edges_start": "Le suspect a au moins un ami avec les cheveux",

@ -8,4 +8,3 @@ enum Sport {
} }
export default Sport export default Sport

@ -2189,6 +2189,11 @@
"@types/qs" "*" "@types/qs" "*"
"@types/serve-static" "*" "@types/serve-static" "*"
"@types/file-saver@^2.0.7":
"integrity" "sha512-dNKVfHd/jk0SkR/exKGj2ggkB45MAkzvWCaqLUUgkyjITkGNzH8H+yUwr+BLJUBjZOe9w8X3wgmXhZDRg1ED6A=="
"resolved" "https://registry.npmjs.org/@types/file-saver/-/file-saver-2.0.7.tgz"
"version" "2.0.7"
"@types/graceful-fs@^4.1.2": "@types/graceful-fs@^4.1.2":
"integrity" "sha512-olP3sd1qOEe5dXTSaFvQG+02VdRXcdytWLAZsAq1PecU8uqQAhkrnbli7DagjtXKW/Bl7YJbUsa8MPcuc8LHEQ==" "integrity" "sha512-olP3sd1qOEe5dXTSaFvQG+02VdRXcdytWLAZsAq1PecU8uqQAhkrnbli7DagjtXKW/Bl7YJbUsa8MPcuc8LHEQ=="
"resolved" "https://registry.npmjs.org/@types/graceful-fs/-/graceful-fs-4.1.9.tgz" "resolved" "https://registry.npmjs.org/@types/graceful-fs/-/graceful-fs-4.1.9.tgz"
@ -4976,6 +4981,11 @@
"loader-utils" "^2.0.0" "loader-utils" "^2.0.0"
"schema-utils" "^3.0.0" "schema-utils" "^3.0.0"
"file-saver@^2.0.5":
"integrity" "sha512-P9bmyZ3h/PRG+Nzga+rbdI4OEpNDzAVyy74uVO9ATgzLK6VtAsYybF/+TOCvrc0MO793d6+42lLyZTw7/ArVzA=="
"resolved" "https://registry.npmjs.org/file-saver/-/file-saver-2.0.5.tgz"
"version" "2.0.5"
"filelist@^1.0.4": "filelist@^1.0.4":
"integrity" "sha512-w1cEuf3S+DrLCQL7ET6kz+gmlJdbq9J7yXCSjK/OZCPA+qEN1WyF4ZAf0YYJa4/shHJra2t/d/r8SV4Ji+x+8Q==" "integrity" "sha512-w1cEuf3S+DrLCQL7ET6kz+gmlJdbq9J7yXCSjK/OZCPA+qEN1WyF4ZAf0YYJa4/shHJra2t/d/r8SV4Ji+x+8Q=="
"resolved" "https://registry.npmjs.org/filelist/-/filelist-1.0.4.tgz" "resolved" "https://registry.npmjs.org/filelist/-/filelist-1.0.4.tgz"

@ -0,0 +1,3 @@
\relax
\@writefile{toc}{\contentsline {paragraph}{Première énigme}{2}{}\protected@file@percent }
\gdef \@abspage@last{2}

Binary file not shown.

@ -0,0 +1,132 @@
\documentclass[11pt]{article}
\usepackage{fullpage}
\usepackage{times}
\usepackage{tikz}
\usepackage{paralist}
\usetikzlibrary {shapes.multipart}
\newcommand{\Basketball}{\includegraphics[width=.5cm]{ballon-de-basket.png}}
\newcommand{\Football}{\includegraphics[width=.4cm]{ballon-de-foot.png}}
\newcommand{\Bowling}{\includegraphics[width=.5cm]{bowling.png}}
\newcommand{\Baseball}{\includegraphics[width=.5cm]{baseball.png}}
\newcommand{\Tennis}{\includegraphics[width=.5cm]{tennis.png}}
\begin{document}
\thispagestyle{empty}
Voici le graphe de SocialGraphe
\begin{center}
\begin{tikzpicture}[scale=.9]
\node[draw, circle split] (0) at (0,0) { Alexander \nodepart{lower} \Football{} \Bowling{}};
\node[draw, circle split] (1) at (4,0) { Wyatt \nodepart{lower} \Baseball{} \Tennis{}};
\node[draw, circle split] (2) at (8,0) { Mia \nodepart{lower} \Basketball{}};
\node[draw, circle split] (3) at (12,0) { William \nodepart{lower} \Baseball{} \Football{}};
\node[draw, circle split] (4) at (16,0) { Zoey \nodepart{lower} \Basketball{} \Bowling{} \Tennis{}};
\node[draw, circle split] (5) at (0,4) { Isabella \nodepart{lower} \Tennis{}};
\node[draw, circle split] (6) at (4,4) { Abigail \nodepart{lower} \Baseball{}};
\node[draw, circle split] (7) at (8,4) { Savannah \nodepart{lower} \Bowling{} \Basketball{} \Football{}};
\node[draw, circle split] (8) at (12,4) { Peyton \nodepart{lower} \Football{}};
\node[draw, circle split] (9) at (16,4) { Alice \nodepart{lower} \Tennis{} \Baseball{}};
\node[draw, circle split] (10) at (0,8) { Sophia \nodepart{lower} \Bowling{} \Basketball{} \Bowling{}};
\node[draw, circle split] (11) at (4,8) { Layla \nodepart{lower} \Tennis{} \Baseball{} \Football{}};
\node[draw, circle split] (12) at (8,8) { Ava \nodepart{lower} \Basketball{}};
\node[draw, circle split] (13) at (12,8) { Harper \nodepart{lower} \Bowling{}};
\node[draw, circle split] (14) at (16,8) { Sebastian \nodepart{lower} \Tennis{} \Basketball{} \Baseball{}};
\node[draw, circle split] (15) at (0,12) { Michael \nodepart{lower} \Football{}};
\node[draw, circle split] (16) at (4,12) { Natalie \nodepart{lower} \Bowling{} \Football{} \Baseball{}};
\node[draw, circle split] (17) at (8,12) { Penelope \nodepart{lower} \Basketball{}};
\node[draw, circle split] (18) at (12,12) { Lily \nodepart{lower} \Tennis{} \Tennis{}};
\node[draw, circle split] (19) at (16,12) { Eleanor \nodepart{lower} \Football{}};
\node[draw, circle split] (20) at (0,16) { Henry \nodepart{lower} \Bowling{} \Basketball{}};
\node[draw, circle split] (21) at (4,16) { Claire \nodepart{lower} \Baseball{} \Basketball{}};
\node[draw, circle split] (22) at (8,16) { Caleb \nodepart{lower} \Baseball{}};
\node[draw, circle split] (23) at (12,16) { Charlotte \nodepart{lower} \Bowling{} \Football{} \Tennis{}};
\node[draw, circle split] (24) at (16,16) { Luke \nodepart{lower} \Football{}};
\node[draw, circle split] (25) at (0,20) { Connor \nodepart{lower} \Baseball{} \Tennis{}};
\node[draw, circle split] (26) at (4,20) { Aiden \nodepart{lower} \Basketball{} \Bowling{} \Tennis{}};
\node[draw, circle split] (27) at (8,20) { Aurora \nodepart{lower} \Football{}};
\node[draw, circle split] (28) at (12,20) { Nathan \nodepart{lower} \Bowling{} \Baseball{}};
\node[draw, circle split] (29) at (16,20) { Aurora \nodepart{lower} \Basketball{}};
\draw (0) -- (11);
\draw (0) -- (13);
\draw (0) -- (18);
\draw (1) -- (13);
\draw (1) -- (24);
\draw (2) -- (22);
\draw (2) -- (16);
\draw (2) -- (9);
\draw (2) -- (6);
\draw (3) -- (4);
\draw (3) -- (20);
\draw (4) -- (28);
\draw (4) -- (3);
\draw (5) -- (17);
\draw (5) -- (15);
\draw (5) -- (24);
\draw (6) -- (2);
\draw (7) -- (17);
\draw (7) -- (24);
\draw (7) -- (22);
\draw (7) -- (11);
\draw (8) -- (25);
\draw (8) -- (21);
\draw (8) -- (24);
\draw (8) -- (11);
\draw (9) -- (2);
\draw (10) -- (25);
\draw (10) -- (26);
\draw (10) -- (27);
\draw (11) -- (0);
\draw (11) -- (7);
\draw (11) -- (8);
\draw (12) -- (20);
\draw (12) -- (27);
\draw (13) -- (0);
\draw (13) -- (1);
\draw (14) -- (15);
\draw (15) -- (5);
\draw (15) -- (14);
\draw (15) -- (20);
\draw (15) -- (17);
\draw (16) -- (2);
\draw (16) -- (26);
\draw (17) -- (5);
\draw (17) -- (7);
\draw (17) -- (15);
\draw (17) -- (20);
\draw (18) -- (0);
\draw (19) -- (23);
\draw (20) -- (3);
\draw (20) -- (12);
\draw (20) -- (15);
\draw (20) -- (17);
\draw (21) -- (8);
\draw (22) -- (2);
\draw (22) -- (7);
\draw (22) -- (23);
\draw (23) -- (19);
\draw (23) -- (22);
\draw (24) -- (1);
\draw (24) -- (5);
\draw (24) -- (7);
\draw (24) -- (8);
\draw (25) -- (8);
\draw (25) -- (10);
\draw (26) -- (10);
\draw (26) -- (16);
\draw (26) -- (29);
\draw (27) -- (10);
\draw (27) -- (12);
\draw (28) -- (4);
\draw (29) -- (26);
\end{tikzpicture}
\end{center}
\paragraph{Première énigme}
Trouver qui est le coupable avec les indices suivants.
\begin{compactitem}
\item Indice 1 : Le suspect pratique au moins du Baseball et/ou du Basketball .
\item Indice 2 : Le suspect pratique 2 ou 1 sport(s).
\item Indice 3 : Le suspect a les cheveux Roux ou Blond .
\item Indice 4 : Le suspect a au moins un ami avec les cheveux Roux .
\end{compactitem}
% Solution : Nathan
\end{document}

Binary file not shown.

After

Width:  |  Height:  |  Size: 25 KiB

Loading…
Cancel
Save