Skip to content

Instantly share code, notes, and snippets.

int** sous_matrice(int** mat, int row, int col, int taille)
{
int i, j, k, l;
int **new_mat;
new_mat = malloc(taille * taille * sizeof (int));
i = 0;
k = 0;
while (k < taille)
{
if (k == row)
@MiLk
MiLk / tp3.c
Created October 18, 2011 13:02
TP3 NF16
#include "tp3.h"
// Fonctions à réaliser
task * cree_tache(char caract[MAX_NOM + 1], int duree)
{
task *ptask = (task*)malloc(sizeof (task));
//strcpy(ptask->ID,caract);
*(ptask->ID) = caract;
ptask->duree = duree;
<!--JOURS-->
<div class="jours">
<img src="./images/landing/compteur/1.png" width="46" height="66" alt="1" class="jours_01"/>
<img src="./images/landing/compteur/5.png" width="46" height="66" alt="5" class="jours_02"/>
<img src="./images/landing/compteur/7.png" width="46" height="66" alt="7" class="jours_03"/>
</div>
<!--HEURES-->
<div class="heures">
<img src="./images/landing/compteur/2.png" width="46" height="66" alt="2" class="heures_01"/>
<img src="./images/landing/compteur/4.png" width="46" height="66" alt="4" class="heures_02"/>
var retour = true;
var tempsTransition = 1000;
var lectureAutomatique = true;
var tempsAttente = 6000;
var interval;
var lectureEnCours = false;
var currentPosition = 0;
var slideWidth = 780;
$(document).ready(function(){
@MiLk
MiLk / faq.js
Created November 1, 2011 16:52
jQuery().ready(function(){
$(".question").next(".reponse").hide();
$(".question").click(function(){
if($(this).next(".reponse").is(":hidden")){
$(".question").next(".reponse:visible").slideUp();
$(".question").removeClass("active");
$(this).addClass("active");
$(this).next(".reponse").slideDown();
}
else
(defun proximite (etat etat-final)
(let ((l1 etat)(l2 etat-final) (retour 0))
(dolist (var l2 retour)
(when (equal (pop l1) var)
(setq retour (+ retour 1)))
)
)
)
(proximite initial final)
(defun inverser (x)
(if (= x 1) 0 1)
)
(defun new-state(state pos)
(when (<= (length state) (+ pos 1)) (return-from new-state state))
(let ((i 0)(new-list '()))
(dolist (arrow state new-list)
(if (or (= i pos) (= i (+ pos 1)))
(setq new-list (append new-list (list (inverser arrow))))
(setq new-list (append new-list (list arrow)))
@MiLk
MiLk / IA01-TP02.cl
Created November 12, 2011 14:03
ia01 tp02
(defvar initial '(0 0 0 1 0 1))
(defvar final '(1 1 1 1 1 1))
(defun inverser (x)
(if (= x 1) 0 1)
)
(defun new-state(state pos)
(when (<= (length state) (+ pos 1)) (return-from new-state state))
(let ((i 0)(new-list '()))
(dolist (arrow state new-list)
(defun explore-depth (state)
(if (equal state final)
(progn
(print state)
T)
(dolist (succ (successors state) NIL)
(progn
(print state)
(if (equal (explore-depth succ) T)
(return T))
Resultat test_cree_tache()
{
return getDiagnostic(cree_tache_cat1(),cree_tache_cat2(),cree_tache_cat3());
}
bool cree_tache_cat1()
{
printf("parametres :\n");
printf("caract :\n");
printf("duree :\n");