Forum |  HardWare.fr | News | Articles | PC | S'identifier | S'inscrire | Shop Recherche
3015 connectés 

  FORUM HardWare.fr
  Programmation
  Algo

  Free_Will

 


 Mot :   Pseudo :  
 
Bas de page
Auteur Sujet :

Free_Will

n°2016620
Profil sup​primé
Posté le 13-08-2010 à 02:43:45  answer
 

Bonjour,
 
je viens d'écrire un programme et j'aurais aimé avoir votre critique dans tous les domaines possibles ou pertinent selon les divers approche que l'on peu avoir.
 
Voici le code, c'est écrit avec Ada, c'est pas sorcier.
 

Code :
  1. type T_Choice is (Chaos, Finality, Equality);
  2.  
  3.   function Action return T_Choice;


Code :
  1. VChaos    : Boolean := False;
  2.   VFinality : Boolean := True;
  3.   VEquality : Boolean := False;
  4.  
  5.  
  6.  
  7. function Action return T_Choice is      
  8.      Choice : T_Choice;      
  9.   begin      
  10.      if VEquality then
  11.      Choice := Random(Choice_Gen);
  12.      case Choice is
  13.         when Chaos =>
  14.            VChaos := not VChaos;      
  15.               VEquality := not VEquality;
  16.            Choice := Equality;
  17.         when Finality =>
  18.            VFinality := not VFinality;
  19.            VEquality := not VEquality;
  20.            Choice := Equality;
  21.         when Equality =>
  22.            Choice := Equality;
  23.      end case;    
  24.      return choice;
  25.      elsif VChaos and not VFinality then
  26.      VFinality := not VFinality;
  27.      VEquality := not VEquality;
  28.      return Chaos;
  29.      elsif not VChaos and VFinality then
  30.      VChaos := not VChaos;
  31.      VEquality := not VEquality;
  32.      return Finality;
  33.      else
  34.      VFinality := not VFinality;
  35.      VChaos := not VChaos;
  36.      VEquality := not VEquality;
  37.      return Equality;
  38.      end if;          
  39.   end Action;


Message édité par Profil supprimé le 13-08-2010 à 02:45:52
mood
Publicité
Posté le 13-08-2010 à 02:43:45  profilanswer
 


Aller à :
Ajouter une réponse
  FORUM HardWare.fr
  Programmation
  Algo

  Free_Will

 

Sujets relatifs
référencer ma page perso freePiratage - Page perso Free - .htaccess
connection pages perso freepourquoi ça marche chez free et pas chez moi ?
Free - mail et contenu html[PHP 5] Pages Perso Free - Passage en php 5
probleme installation de forum sur freephpmyvisites sur free
Problème installation joomla chez freeProblème de connection FREE à SQL.FREE.FR ?? Mystère!
Plus de sujets relatifs à : Free_Will


Copyright © 1997-2022 Hardware.fr SARL (Signaler un contenu illicite / Données personnelles) / Groupe LDLC / Shop HFR