This commit is contained in:
flo 2017-04-11 10:11:15 +02:00
parent 574b4a000d
commit 8be7d33e8f
7 changed files with 273 additions and 441 deletions

View File

@ -5,71 +5,24 @@
unsigned int key;
struct Element
{
unsigned char nom[14]; // le nom
unsigned char symbol[4]; // le symbole
unsigned char valence; // le nombre de valence
unsigned int groupe : 5; //le groupe //x
unsigned int periode : 3; // la période // y
float electro_neg; // electro negativité
unsigned int masse_mol; // la masse molaire // que l'on divise par 1000
unsigned char config_electro[7];// la config électronique
unsigned int famille : 4;
unsigned int etat : 4;
};
/*# define element_value(GROUP, PERIODE, VALENCE, MASSEMOL) \
(((GROUP) << 29) | ((PERIODE) << 24) | (((VALENCE) + 1) << 19) | (MASSEMOL))
# define group(E) ((E).value >> 29)
# define periode(E) (((E).value >> 24) & 0x1F)
# define massemol(E) ((E).value & 0x7FFFF)
# define valence(E) ((((E).value >> 19) & 0x1F) - 1)
struct Element {
// string information
const uint8_t *nom;
const uint8_t symbol[4];
// values
uint32_t value; // group //x, periode //y, valence, massemol
uint8_t elec[7];
uint16_t elecneg;
uint8_t above, below;
};*/
/* struct Element
{
{
unsigned char nom[14]; // le nom
unsigned char symbol[4]; // le symbole
unsigned int masse_mol; // la masse molaire // que l'on divise par 1000
unsigned char config_electro[7];// la config électronique
unsigned int groupe : 5; //le groupe //x
unsigned int periode : 3; // la période // y
unsigned char valence; // le nombre de valence
float electro_neg; // electro negativité
unsigned char dessus; // element au dessus de celui actuel
unsigned char dessous; // element en dessous de celui actuel
};*/
//1 : 1
//11 : 3
//111 : 7
//1111 : 15
//11111 : 31
//111111 : 63
//1111111 : 127
//11111111 : 255
struct Detail
{
short annee ;
unsigned int famille : 4;
unsigned int etat : 4;
unsigned int valence : 4;
unsigned int masse_mol : 20; // masse molaire * 1000
unsigned int groupe : 5; // x
unsigned int periode : 3; //u
unsigned int electro_neg :9; //electroneg *100
unsigned int famille : 4;
unsigned int etat : 3;
unsigned char config_electro[7];// la config électronique
//octet de flottement //align(4)
};
int detailsElement(int); //chang //a

BIN
misc/icon.bmp Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 138 B

Binary file not shown.

BIN
periodiq.bin Executable file

Binary file not shown.

BIN
periodiq.elf Executable file

Binary file not shown.

BIN
periodiq.g1a Normal file

Binary file not shown.

View File

@ -4,7 +4,7 @@
/* */
/* File name : [ProjectName].c */
/* */
/* Copyright (c) 2006 CASIO COMPUTER CO., LTD. */
/* Copyright (c) 2006 CASIO COMPUTER CO., LTD. */
/* */
/*****************************************************************/
#include "periodiq.h"
@ -22,14 +22,14 @@
int atoi(const char *str)
{
// Variables declaration.
int n=0, sign=1;
int n=0, sign=1;
// Parsing string until the first glyph.
while(isspace(*str)) str++;
// Checking sign.
if(*str=='-') sign=-1, str++;
else if(*str=='+') sign=+1, str++;
if(*str=='-') sign=-1, str++;
else if(*str=='+') sign=+1, str++;
// Reading digits.
while(isdigit(*str))
@ -57,270 +57,149 @@ int atoi(const char *str)
struct Element elements[] =
{
{ /*1, */"Hydrogene","H",1008,{1},1,1,1,2.20,0,2},
{ /*2, */"Helium","He",4003,{2},18,1,0,0,1,9},
{ /*3, */"Lithium","Li",6940,{2,1},1,2,1,0,0,10},
{ /*4, */"Beryllium","Be",9012,{2,2},2,2,2,1.57,0,11},
{ /*5, */"Bore","B",10810,{2,3},13,2,2,2.04,1,12},
{ /*6, */"Carbone","C",12011,{2,4},14,2,3,2.55,1,13},
{ /*7, */"Azote","N",14007,{2,5},15,2,4,3.04,1,14},
{ /*8, */"Oxygene","O",15999,{2,6},16,2,5,3.44,1,15},
{ /*9, */"Fluor","F",18998,{2,7},17,2,2,3.98,1,16},
{/*10, */"Neon","Ne",20178,{2,8},18,2,0,0,1,17},
{/*11, */"Sodium","Na",22990,{2,8,1},1,3,1,0.93,2,18},
{/*12, */"Magnesium","Mg",24305,{2,8,2},2,3,2,1.31,3,19},
{/*13, */"Aluminium","Al",26982,{2,8,3},13,3,3,1.61,4,30},
{/*14, */"Silicium","Si",28085,{2,8,4},14,3,4,1.90,5,31},
{/*15, */"Phosphore","P",30974,{2,8,5},15,3,5,2.19,6,32},
{/*16, */"Soufre","S",32060,{2,8,6},16,3,6,2.58,7,33},
{/*17, */"Chlore","Cl",35450,{2,8,7},17,3,7,3.16,8,34},
{/*18, */"Argon","Ar",39948,{2,8,8},18,3,2,0,9,35},
{/*19, */"Potassium","K",39098,{2,8,8,1},1,4,1,0.82,10,36},
{/*20, */"Calcium","Ca",40078,{2,8,8,2},2,4,2,1.0,11,37},
{/*21, */"Scandium","Sc",44956,{2,8,9,2},3,4,3,1.36,20,38},
{/*22, */"Titane","Ti",47867,{2,8,10,2},4,4,4,1.54,21,39},
{/*23, */"Vanadium","Va",50941,{2,8,11,2},5,4,5,1.63,22,40},
{/*24, */"Chrome","Cr",51996,{2,8,13,1},6,4,6,1.66,23,41},
{/*25, */"Manganese","Mn",54380,{2,8,13,2},7,4,7,1.55,24,42},
{/*26, */"Fer","Fe",55845,{2,8,14,2},8,4,6,1.83,25,43},
{/*27, */"Cobalt","Co",58933,{2,8,15,2},9,4,5,1.88,26,44},
{/*28, */"Nickel","Ni",58693,{2,8,16,2},10,4,4,1.91,27,45},
{/*29, */"Cuivre","Cu",63546,{2,8,18,1},11,4,4,1.90,28,46},
{/*30, */"Zinc","Zn",65380,{2,8,18,2},12,4,2,1.65,29,47},
{/*31, */"Gallium","Ga",69723,{2,8,18,3},13,4,3,1.81,12,48},
{/*32, */"Germanium","Gr",72630,{2,8,18,4},14,4,4,2.01,13,49},
{/*33, */"Arsenic","As",74921,{2,8,18,5},15,4,5,2.18,14,50},
{/*34, */"Selenium","Se",78971,{2,8,18,6},16,4,6,2.55,15,51},
{/*35, */"Brome","Br",79904,{2,8,18,7},17,4,7,2.96,16,52},
{/*36, */"Krypton","Kr",83798,{2,8,18,8},18,4,2,3.00,17,53},
{/*37, */"Rubidium","Rb",85468,{2,8,18,8,1},1,5,1,0.82,18,54},
{/*38, */"Strontium","Sr",87620,{2,8,18,8,2},2,5,2,0.95,19,55},
{/*39, */"Yttrium","Y",88906,{2,8,18,9,2},3,5,3,1.22,20,56},
{/*40, */"Zirconium","Zr",91224,{2,8,18,10,2},4,5,4,1.33,21,71},
{/*41, */"Niobium","Nb",92906,{2,8,18,12,1},5,5,5,1.6,22,72},
{/*42, */"Molybdene","Mo",95950,{2,8,18,13,1},6,5,6,2.16,23,73},
{/*43, */"Technetium","Tc",98000,{2,8,18,13,2},7,5,7,1.9,24,74},
{/*44, */"Ruthenium","Ru",101070,{2,8,18,15,1},8,5,8,2.2,25,75},
{/*45, */"Rhodium","Rh",102906,{2,8,18,16,1},9,5,6,2.28,26,76},
{/*46, */"Palladium","Pd",106420,{2,8,18,18},10,5,4,2.20,27,77},
{/*47, */"Argent","Ag",107869,{2,8,18,18,1},11,5,4,1.93,28,78},
{/*48, */"Cadmium","Cd",112414,{2,8,18,18,2},12,5,2,1.69,29,79},
{/*49, */"Indium","In",114818,{2,8,18,18,3},13,5,3,1.78,30,80},
{/*50, */"Etain","Sn",118710,{2,8,18,18,4},14,5,4,1.96,31,81},
{/*51, */"Antimoine","Sb",121760,{2,8,18,18,5},15,5,5,2.05,32,82},
{/*52, */"Tellure","Te",127600,{2,8,18,18,6},16,5,6,2.55,33,83},
{/*53, */"Iode","I",126904,{2,8,18,18,7},17,5,7,2.66,34,84},
{/*54, */"Xenon","Xe",130293,{2,8,18,18,8},18,5,8,2.6,35,85},
{/*55, */"Cesium","Cs",132905,{2,8,18,18,8,1},1,6,1,0.79,36,86},
{/*56, */"Baryum","Ba",137327,{2,8,18,18,8,2},2,6,2,0.89,37,87},
{/*57, */"Lanthane","La",138910,{2,8,18,19,8,2},4,6,3,1.10,103,88}, // lanthanides
{/*58, */"Cerium","Ce",140116,{2,8,18,19,8,2},5,6,4,1.12,104,89},
{/*59, */"Praseodyme","Pr",140907,{2,8,18,21,8,2},6,6,4,1.13,105,90},
{/*60, */"Neodyme","Nd",144242,{2,8,18,22,8,2},7,6,3,1.14,106,91},
{/*61, */"Promethium","Pm",145000,{2,8,18,23,8,2},8,6,3,0,107,92},
{/*62, */"Samarium","Sm",150360,{2,8,18,24,8,2},9,6,3,1.17,108,93},
{/*63, */"Europium","Eu",151964,{2,8,18,25,8,2},10,6,3,0,109,94},
{/*64, */"Gadolinium","Gd",157250,{2,8,18,25,9,2},11,6,3,1.20,110,95},
{/*65, */"Terbium","Tb",158925,{2,8,18,27,8,2},12,6,4,0,111,96},
{/*66, */"Dysprosium","Dy",162500,{2,8,18,28,8,2},13,6,3,1.22,112,97},
{/*67, */"Holmium","Ho",164930,{2,8,18,29,8,2},14,6,3,1.23,113,98},
{/*68, */"Erbium","Er",167259,{2,8,18,30,8,2},15,6,3,1.24,114,99},
{/*69, */"Thulium","Tm",168934,{2,8,18,31,8,2},16,6,3,1.25,115,100},
{/*70, */"Yttrebium","Yb",173054,{2,8,18,32,8,2},17,6,3,0,116,101},
{/*71, */"Lutecium","Lu",174967,{2,8,18,32,9,2},18,6,3,1.27,117,102},//fin des lanthanides
{/*72, */"Hafnium","Hf",178490,{2,8,18,32,10,2},4,6,4,1.3,39,103},
{/*73, */"Tantale","Ta",180948,{2,8,18,32,11,2},5,6,5,1.5,40,104},
{/*74, */"Tungstene","W",183840,{2,8,18,32,12,2},6,6,6,2.36,41,105},
{/*75, */"Rhenium","Re",186207,{2,8,18,32,13,2},7,6,7,1.9,42,106},
{/*76, */"Osmium","Os",190230,{2,8,18,32,14,2},8,6,8,2.2,43,107},
{/*77, */"Iridium","Ir",192217,{2,8,18,32,15,2},9,6,8,2.20,44,108},
{/*78, */"Platine","Pt",195084,{2,8,18,32,1,1},10,6,6,2.28,45,109},
{/*79, */"Or","Au",196967,{2,8,18,32,18,1},11,6,5,2.54,46,110},
{/*80, */"Mercure","Hg",200590,{2,8,18,32,18,2},12,6,4,2.0,47,111},
{/*81, */"Thallium","Tl",204380,{2,8,18,32,18,3},13,6,3,1.62,48,112},
{/*82, */"Plomb","Pb",207200,{2,8,18,32,18,4},14,6,4,2.33,49,113},
{/*83, */"Bismuth","Bi",208980,{2,8,18,32,18,5},15,6,5,2.02,50,114},
{/*84, */"Polonium","Po",209000,{2,8,18,32,18,6},16,6,6,2.0,51,115},
{/*85, */"Astate","At",210000,{2,8,18,32,18,7},17,6,7,2.2,52,116},
{/*86, */"Radon","Rn",212000,{2,8,18,32,18,8},18,6,6,0,53,117},
{/*87, */"Francium","Fr",223000,{2,8,18,32,18,8,1},1,7,1,0.7,54,86},
{/*88, */"Radium","Ra",226000,{2,8,18,32,18,8,2},2,7,2,0.9,55,87},
{/*89, */"Actinium","Ac",227000,{2,8,18,32,18,9,2},4,7,3,1.1,56,88}, // actinide
{/*90, */"Thorium","Th",232038,{2,8,18,32,18,10,2},5,7,4,1.3,57,89},
{/*91, */"Protactinium","Pa",231036,{2,8,18,32,20,9,2},6,7,5,1.5,58,90},
{/*92, */"Uranium","U",238029,{2,8,18,32,21,9,2},7,7,6,1.38,59,91},
{/*93, */"Neptunium","Np",237000,{2,8,18,32,22,9,2},8,7,7,1.36,60,92},
{/*94, */"Plutonium","Pu",244000,{2,8,18,32,24,8,2},9,7,8,1.28,61,93},
{/*95, */"Americum","Am",243000,{2,8,18,32,25,8,2},10,7,6,1.3,62,94},
{/*96, */"Curium","Cm",247000,{2,8,18,32,25,9,2},11,7,4,1.3,63,95},
{/*97, */"Berkelium","Bk",247000,{2,8,18,32,28,8,2},12,7,4,1.3,64,96},
{/*98, */"Californium","Cf",251000,{2,8,18,32,28,8,2},13,7,4,1.3,65,97},
{/*99, */"Einsteinium","Es",252000,{2,8,18,32,29,8,2},14,7,3,1.3,66,98},
{/*100,*/"Fermium","Fm",257000,{2,8,18,32,30,8,2},15,7,3,1.3,67,99},
{/*101,*/"Mendelevium","Md",258000,{2,8,18,32,31,8,2},16,7,3,1.3,68,100},
{/*102,*/"Nobelium","No",259000,{2,8,18,32,32,8,2},17,7,3,1.3,69,101},
{/*103,*/"Lawrencium","Lr",262000,{2,8,18,32,32,8,3},18,7,3,0,70,102},// fin des actinides
{/*104,*/"Rutherfordium","Rf",267000,{2,8,18,32,32,10,2},4,7,4,0,71,56},
{/*105,*/"Dubnium","Db",268000,{2,8,18,32,32,11,2},5,7,5,0,72,57},
{/*106,*/"Seaborg","Sg",271000,{2,8,18,32,32,12,2},6,7,6,0,73,58},
{/*107,*/"Bohrium","Bh",272000,{2,8,18,32,32,13,2},7,7,7,0,74,59},
{/*108,*/"Hassium","Hs",270000,{2,8,18,32,32,14,2},8,7,8,0,75,60},
{/*109,*/"Meitnerium","Mt",276000,{2,8,18,32,32,15,2},9,7,-1,0,76,61}, // -1 corespond à "inconnu"
{/*110,*/"Darmstadium","Ds",281000,{2,8,18,32,32,17,1},10,7,-1,0,77,62},
{/*111,*/"Roengenium","Rg",280000,{2,8,18,32,32,18,1},11,7,-1,0,78,63},
{/*112,*/"Copernicium","Cn",285000,{2,8,18,32,32,18,2},12,7,-1,0,79,64},
{/*113,*/"Ununtrium","Uut",284000,{2,8,18,32,32,18,3},13,7,-1,0,80,65},
{/*114,*/"Flerovium","Fl",289000,{2,8,18,32,32,18,4},14,7,-1,0,81,66},
{/*115,*/"Ununpentium","Uup",288000,{2,8,18,32,32,18,5},15,7,-1,0,82,67},
{/*116,*/"Livermorium","Lv",288000,{2,8,18,32,32,18,6},16,7,-1,0,83,68},
{/*117,*/"Ununseptium","Uus",294000,{2,8,18,32,32,18,7},17,7,-1,0,84,69},
{/*118,*/"Ununoctium","Uun",294000,{2,8,18,32,32,18,8},18,7,-1,0,85,70}
};
struct Detail ajout[] = {
{1766,0,1},
{1895,2,1},
{1817,4,0},
{1797,5,0},
{1808,3,0},
{-3750,0,0},
{1772,0,1},
{1774,0,1},
{1886,1,1},
{1898,2,1},//10
{1807,4,0},
{1755,5,0},
{1825,9,0},
{1824,3,0},
{1669,0,0},
{-500,0,0},
{1774,1,1},
{1894,2,1},
{1807,4,0},
{1808,5,0},//20
{1879,8,0},
{1791,8,0},
{1801,8,0},
{1797,8,0},
{1774,8,0},
{-2000,8,0},
{1735,8,0},
{1751,8,0},
{-8000,8,0},
{1500,8,0},//30
{1875,9,0},
{1886,3,0},
{1250,3,0},
{1817,0,0},
{1826,1,2},
{1898,2,1},
{1861,4,0},
{1790,5,0},
{1794,8,0},
{1789,8,0},//40
{1801,8,0},
{1781,8,0},
{1937,8,0},
{1844,8,0},
{1803,8,0},
{1803,8,0},
{-3000,8,0},
{1817,8,0},
{1863,9,0},
{-3000,9,0},//50
{-3000,3,0},
{1783,3,0},
{1811,1,0},
{1898,2,1},
{1860,4,0},
{1808,5,0},
{1839,6,0},
{1803,6,0},
{1885,6,0},
{1885,6,0},//60
{1945,6,0},
{1879,6,0},
{1901,6,0},
{1880,6,0},
{1843,6,0},
{1886,6,0},
{1878,6,0},
{1842,6,0},
{1879,6,0},
{1878,6,0},//70
{1907,6,0},
{1923,8,0},
{1802,8,0},
{1783,8,0},
{1925,8,0},
{1803,8,0},
{1803,8,0},
{1735,8,0},
{-2500,8,0},
{-1500,8,2},//80
{1861,9,0},
{-4000,9,0},
{1400,9,0},
{1898,3,0},
{1940,1,0},
{1900,2,1},
{1939,4,0},
{1898,5,0},
{1899,7,0},
{1829,7,0},//90
{1913,7,0},
{1789,7,0},
{1940,7,0},
{1940,7,0},
{1944,7,0},
{1944,7,0},
{1949,7,0},
{1950,7,0},
{1952,7,0},
{1950,7,0},//100
{1955,7,0},
{1958,7,0},
{1961,7,0},
{1964,8,3},
{1967,8,3},
{1974,8,3},
{1981,8,3},
{1984,8,3},
{1982,8,3},
{1994,8,3},//110
{1994,8,3},
{1996,8,3},
{2004,9,3},
{1998,9,3},
{2004,9,3},
{2000,9,3},
{2010,1,3},
{2006,2,3}
{ /*1 */"Hydrogene", "H", 1, 1008, 1, 1, 220, 0, 1, {1} },
{ /*2 */"Helium", "He", 0, 4003, 18, 1, -1, 2, 1, {2} },
{ /*3 */"Lithium", "Li", 1, 6940, 1, 2, 98, 4, 0, {2, 1} },
{ /*4 */"Beryllium", "Be", 2, 9012, 2, 2, 157, 5, 0, {2, 2} },
{ /*5 */"Bore", "B", 3, 10810, 13, 2, 204, 3, 0, {2, 3} },
{ /*6 */"Carbone", "C", 4, 12011, 14, 2, 255, 0, 0, {2, 4} },
{ /*7 */"Azote", "N", 5, 14007, 15, 2, 304, 0, 1, {2, 5} },
{ /*8 */"Oxygene", "O", 2, 15999, 16, 2, 344, 0, 1, {2, 6} },
{ /*9 */"Fluor", "F", 1, 18998, 17, 2, 398, 1, 1, {2, 7} },
{/*10 */"Neon", "Ne", 0, 20178, 18, 2, -1, 2, 1, {2, 8} },
{/*11 */"Sodium", "Na", 1, 22990, 1, 3, 93, 4, 0, {2, 8, 1} },
{/*12 */"Magnesium", "Mg", 2, 24305, 2, 3, 131, 5, 0, {2, 8, 2} },
{/*13 */"Aluminium", "Al", 3, 26982, 13, 3, 161, 9, 0, {2, 8, 3} },
{/*14 */"Silicium", "Si", 4, 28085, 14, 3, 190, 3, 0, {2, 8, 4} },
{/*15 */"Phosphore", "P", 5, 30974, 15, 3, 219, 0, 0, {2, 8, 5} },
{/*16 */"Soufre", "S", 6, 32060, 16, 3, 258, 0, 0, {2, 8, 6} },
{/*17 */"Chlore", "Cl", 7, 35450, 17, 3, 316, 1, 1, {2, 8, 7} },
{/*18 */"Argon", "Ar", 2, 39948, 18, 3, -1, 2, 1, {2, 8, 8} },
{/*19 */"Potassium", "K", 1, 39098, 1, 4, 82, 4, 0, {2, 8, 8, 1} },
{/*20 */"Calcium", "Ca", 2, 40078, 2, 4, 100, 5, 0, {2, 8, 8, 2} },
{/*21 */"Scandium", "Sc", 3, 44956, 3, 4, 136, 8, 0, {2, 8, 9, 2} },
{/*22 */"Titane", "Ti", 4, 47867, 4, 4, 154, 8, 0, {2, 8, 10, 2} },
{/*23 */"Vanadium", "Va", 5, 50941, 5, 4, 163, 8, 0, {2, 8, 11, 2} },
{/*24 */"Chrome", "Cr", 6, 51996, 6, 4, 166, 8, 0, {2, 8, 13, 1} },
{/*25 */"Manganese", "Mn", 7, 54380, 7, 4, 155, 8, 0, {2, 8, 13, 2} },
{/*26 */"Fer", "Fe", 6, 55845, 8, 4, 183, 8, 0, {2, 8, 14, 2} },
{/*27 */"Cobalt", "Co", 5, 58933, 9, 4, 188, 8, 0, {2, 8, 15, 2} },
{/*28 */"Nickel", "Ni", 4, 58693, 10, 4, 191, 8, 0, {2, 8, 16, 2} },
{/*29 */"Cuivre", "Cu", 4, 63546,11, 4, 190, 8, 0, {2, 8, 18, 1} },
{/*30 */"Zinc", "Zn", 2, 65380, 12, 4, 165, 8, 0, {2, 8, 18, 2} },
{/*31 */"Gallium", "Ga", 3, 69723, 13, 4, 181, 9, 0, {2, 8, 18, 3} },
{/*32 */"Germanium", "Ge", 4, 72630, 14, 4, 201, 3, 0, {2, 8, 18, 4} },
{/*33 */"Arsenic", "As", 4, 74921, 15, 4, 218, 3, 0, {2, 8, 18, 5} },
{/*34 */"Selenium", "Se", 6, 78971, 16, 4, 255, 0, 0, {2, 8, 18, 6} },
{/*35 */"Brome", "Br", 7, 79904, 17, 4, 296, 1, 2, {2, 8, 18, 7} },
{/*36 */"Krypton", "Kr", 2, 83798, 18, 4, 300 , 2, 1, {2, 8, 18, 8} },
{/*37 */"Rubidium", "Rb", 1, 85468, 1, 5, 82, 4, 0, {2, 8, 18, 8, 1} },
{/*38 */"Strontium", "Sr", 2, 87620, 2, 5, 95, 5, 0, {2, 8, 18, 8, 2} },
{/*39 */"Yttrium", "Y", 3, 88906, 3, 5, 122, 8, 0, {2, 8, 18, 9, 2} },
{/*40 */"Zirconium", "Zr", 4, 91224, 4, 5, 133, 8, 0, {2, 8, 18, 10, 2} },
{/*41 */"Niobium", "Nb", 5, 92906, 5, 5, 160, 8, 0, {2, 8, 18, 12, 1} },
{/*42 */"Molybdene", "Mo", 6, 95950, 6, 5, 216, 8, 0, {2, 8, 18, 13, 1} },
{/*43 */"Technetium", "Tc", 7, 98000, 7, 5, 190, 8, 0, {2, 8, 18, 13, 2} },
{/*44 */"Ruthenium", "Ru", 8, 101070, 8, 5, 220, 8, 0, {2, 8, 18, 15, 1} },
{/*45 */"Rhodium", "Rh", 6, 102906, 9, 5, 228, 8, 0, {2, 8, 18, 16, 1} },
{/*46 */"Palladium", "Pd", 4, 106420, 10, 5, 8, 0, 220, {2, 8, 18, 18} },
{/*47 */"Argent", "Ag", 4, 107869, 11, 5, 8, 0, 193, {2, 8, 18, 18, 1} },
{/*48 */"Cadmium", "Cd", 2, 112414, 12, 5, 8, 0, 169, {2, 8, 18, 18, 2} },
{/*49 */"Indium", "In", 2, 114818, 13, 5, 9, 0, 178, {2, 8, 18, 18, 3} },
{/*50 */"Etain", "Sn", 3, 118710, 14, 5, 9, 0, 196, {2, 8, 18, 18, 4} },
{/*51 */"Antimoine", "Sb", 5, 121760, 15, 5, 205, 3, 0, {2, 8, 18, 18, 5} },
{/*52 */"Tellure", "Te", 6, 127600, 16, 5, 210, 3, 0, {2, 8, 18, 18, 6} },
{/*53 */"Iode", "I", 7, 126904, 17, 5, 266, 1, 0, {2, 8, 18, 18, 7} },
{/*54 */"Xenon", "Xe", 8, 130293, 18, 5, 260, 2, 1, {2, 8, 18, 18, 8} },
{/*55 */"Cesium", "Cs", 1, 132905, 1, 6, 79, 4, 0, {2, 8, 18, 18, 8, 1} },
{/*56 */"Baryum", "Ba", 2, 137327, 2, 6, 89, 5, 0 ,{2, 8, 18, 18, 8, 2} },
{/*57 */"Lanthane", "La", 3, 138910, 4, 6, 110, 6, 0, {2, 8, 18, 19, 8, 2} }, // lanthanides
{/*58 */"Cerium", "Ce", 4, 140116, 5, 6, 112, 6, 0, {2, 8, 18, 19, 8, 2} },
{/*59 */"Praseodyme", "Pr", 4, 140907, 6, 6, 113, 6, 0, {2, 8, 18, 21, 8, 2} },
{/*60 */"Neodyme", "Nd", 3, 144242, 7, 6, 114, 6, 0, {2, 8, 18, 22, 8, 2} },
{/*61 */"Promethium", "Pm", 3, 145000, 8, 6, -1, 6, 0, {2, 8, 18, 23, 8, 2} },
{/*62 */"Samarium", "Sm", 2, 150360, 9, 6, 117, 6, 0, {2, 8, 18, 24, 8, 2} },
{/*63 */"Europium", "Eu", 3, 151964, 10, 6, -1, 6, 0, {2, 8, 18, 25, 8, 2} },
{/*64 */"Gadolinium", "Gd", 3, 157250, 11, 6, 120, 6, 0, {2, 8, 18, 25, 9, 2} },
{/*65 */"Terbium", "Tb", 4, 158925, 12, 6, -1, 6, 0,{2, 8, 18, 27, 8, 2} },
{/*66 */"Dysprosium", "Dy", 3, 162500, 13, 6, 112, 6, 0, {2, 8, 18, 28, 8, 2} },
{/*67 */"Holmium", "Ho", 3, 164930, 14, 6, 123, 6, 0, {2, 8, 18, 29, 8, 2} },
{/*68 */"Erbium", "Er", 3, 167259, 15, 6, 124, 6, 0, {2, 8, 18, 30, 8, 2} },
{/*69 */"Thulium", "Tm", 3, 168934, 16, 6, 125, 6, 0, {2, 8, 18, 31, 8, 2} },
{/*70 */"Yttrebium", "Yb", 3, 173054, 17,6, -1, 6, 0, {2, 8, 18, 32, 8, 2} },
{/*71 */"Lutecium", "Lu", 3, 174967, 18, 6, 127, 6, 0, {2, 8, 18, 32, 9, 2} }, //fin des lanthanides
{/*72 */"Hafnium", "Hf", 4, 178490, 4, 6, 130, 8, 0, {2, 8, 18, 32, 10, 2} },
{/*73 */"Tantale", "Ta", 5, 180948, 5, 6, 150, 8, 0, {2, 8, 18, 32, 11, 2} },
{/*74 */"Tungstene", "W", 6, 183840, 6, 6, 236, 8, 0, {2, 8, 18, 32, 12, 2} },
{/*75 */"Rhenium", "Re", 7, 186207, 7, 6, 190, 8, 0, {2, 8, 18, 32, 13, 2} },
{/*76 */"Osmium", "Os", 8, 190230, 8, 6, 220, 8, 0, {2, 8, 18, 32, 14, 2} },
{/*77 */"Iridium", "Ir", 8, 192217, 9, 6, 220, 8, 0, {2, 8, 18, 32, 15, 2} },
{/*78 */"Platine", "Pt", 6, 195084, 10, 6, 228, 8, 0, {2, 8, 18, 32, 1, 1} },
{/*79 */"Or", "Au", 5, 196967, 11, 6, 254, 8, 0, {2, 8, 18, 32, 18, 1} },
{/*80 */"Mercure", "Hg", 4, 200590, 12, 6, 200, 8, 2, {2, 8, 18, 32, 18, 2} },
{/*81 */"Thallium", "Tl", 3, 204380, 13, 6, 162, 9, 0, {2, 8, 18, 32, 18, 3} },
{/*82 */"Plomb", "Pb", 4, 207200, 14, 6, 233, 9, 0, {2, 8, 18, 32, 18, 4} },
{/*83 */"Bismuth", "Bi", 5, 208980, 15, 6, 202, 9, 0, {2, 8, 18, 32, 18, 5} },
{/*84 */"Polonium", "Po", 6, 209000, 16, 6, 200, 3, 0, {2, 8, 18, 32, 18, 6} },
{/*85 */"Astate", "At", 7, 210000, 17, 6, 220, 1, 0, {2, 8, 18, 32, 18, 7} },
{/*86 */"Radon", "Rn", 6, 212000, 18, 6, -1, 2, 1, {2, 8, 18, 32, 18, 8} },
{/*87 */"Francium", "Fr", 1, 223000, 1, 7, 70, 4, 0, {2, 8, 18, 32, 18, 8, 1} },
{/*88 */"Radium", "Ra", 2, 226000, 2, 7, 90, 5, 0, {2, 8, 18, 32, 18, 8, 2} },
{/*89 */"Actinium", "Ac", 3, 227000, 4, 7, 110, 7, 0, {2, 8, 18, 32, 18, 9, 2} }, // actinide
{/*90 */"Thorium", "Th", 4, 232038, 5, 7, 130, {2, 8, 18, 32, 18, 10, 2} },
{/*91 */"Protactinium", "Pa", 5, 231036, 6, 7, 150, 7, 0, {2, 8, 18, 32, 20, 9, 2} },
{/*92 */"Uranium", "U", 6, 238029, 7, 7, 138, 7, 0, {2, 8, 18, 32, 21, 9, 2} },
{/*93 */"Neptunium", "Np", 7, 237000, 8, 7, 136, 7, 0, {2, 8, 18, 32, 22, 9, 2} },
{/*94 */"Plutonium", "Pu", 8, 244000, 9, 7, 128, 7, 0, {2, 8, 18, 32, 24, 8, 2} },
{/*95 */"Americum", "Am", 6, 243000, 10, 7, 130, 7, 0, {2, 8, 18, 32, 25, 8, 2} },
{/*96 */"Curium", "Cm", 4, 247000, 11, 7, 130, 7, 0, {2, 8, 18, 32, 25, 9, 2} },
{/*97 */"Berkelium", "Bk", 4, 247000, 12, 7, 130, 7, 0, {2, 8, 18, 32, 28, 8, 2} },
{/*98 */"Californium", "Cf", 4, 251000, 13, 7, 130, 7, 0, {2, 8, 18, 32, 28, 8, 2} },
{/*99 */"Einsteinium", "Es", 3, 252000, 14, 7, 130, 7, 0, {2, 8, 18, 32, 29, 8, 2} },
{/*100 */"Fermium", "Fm", 3, 257000, 15, 7, 130, 7, 0, {2, 8, 18, 32, 30, 8, 2} },
{/*101 */"Mendelevium", "Md", 3, 258000, 16, 7, 130, 7, 0, {2, 8, 18, 32, 31, 8, 2} },
{/*102 */"Nobelium", "No", 3, 259000, 17, 7, 130, 7, 0, {2, 8, 18, 32, 32, 8, 2} },
{/*103 */"Lawrencium", "Lr", 3, 262000, 18, 7, -1, 7, 0, {2, 8, 18, 32, 32, 8, 3} }, // fin des actinides
{/*104 */"Rutherfordium", "Rf", 4, 267000, 4, 7, -1, 8, 3, {2, 8, 18, 32, 32, 10, 2} },
{/*105 */"Dubnium", "Db", 5, 268000, 5, 7, -1, 8, 3, {2, 8, 18, 32, 32, 11, 2} },
{/*106 */"Seaborg", "Sg", 6, 271000, 6, 7, -1, 8, 3, {2, 8, 18, 32, 32, 12, 2} },
{/*107 */"Bohrium", "Bh", 7, 272000, 7, 7, -1, 8, 3, {2, 8, 18, 32, 32, 13, 2} },
{/*108 */"Hassium", "Hs", 8, 270000, 8, 7, -1, 8, 3, {2, 8, 18, 32, 32, 14, 2} },
{/*109 */"Meitnerium", "Mt", -1, 276000, 9, 7, -1, 8, 3, {2, 8, 18, 32, 32, 15, 2} },
{/*110 */"Darmstadium", "Ds", -1, 281000, 10, 7, -1, 8, 3, {2, 8, 18, 32, 32, 17, 1} },
{/*111 */"Roengenium", "Rg", -1,280000, 11, 7, -1, 8, 3, {2, 8, 18, 32, 32, 18, 1} },
{/*112 */"Copernicium", "Cn", -1, 285000, 12, 7, -1, 8, 3, {2, 8, 18, 32, 32, 18, 2} },
{/*113 */"Ununtrium", "Uut", -1, 284000, 13, 7, -1, 9, 3, {2, 8, 18, 32, 32, 18, 3} },
{/*114 */"Flerovium", "Fl", -1, 289000, 14, 7, -1, 9, 3, {2, 8, 18, 32, 32, 18, 4} },
{/*115 */"Ununpentium", "Uup", -1, 288000, 15, 7, -1, 9, 3, {2, 8, 18, 32, 32, 18, 5} },
{/*116 */"Livermorium", "Lv", -1, 288000, 16, 7, -1, 9, 3, {2, 8, 18, 32, 32, 18, 6} },
{/*117 */"Ununseptium", "Uus", -1, 294000, 17, 7, -1, 1, 3, {2, 8, 18, 32, 32, 18, 7} },
{/*118 */"Ununoctium", "Uun", -1, 294000, 18, 7, -1, 2, 3, {2, 8, 18, 32, 32, 18, 8} },
};
char *family[25] ={
{"non metaux"},//0
{"halogene"},//1
{"gaz rare"},//2
{"metalloide"},//3
{"metal alcalin"},//4
{"metal alcalino terreux"},//5
{"lanthanide"},//6
{"actinide"},//7
{"metal de transition"},//8
{"non metaux"}, //0
{"halogene"}, //1
{"gaz rare"}, //2
{"metalloide"}, //3
{"metal alcalin"}, //4
{"metal alcalino terreux"}, //5
{"lanthanide"}, //6
{"actinide"}, //7
{"metal de transition"}, //8
{"post transition metal"}//9
};
char *etat[9]={
{"solide"},//0
{"gaz"},//1
{"liquide"},//2
{"inconnu"},//3
{"solide"}, //0
{"gaz"}, //1
{"liquide"}, //2
{"inconnu"}, //3
};
extern Font font_modern;
//extern Font font_modern;
//text_configure(font_modern, color_black);
//text_configure(font_modern, color_black);
int main()
{
@ -329,22 +208,22 @@ tableauElement(0);
}
void Mini(char* chaine, int n ) // fonc defini le numero de la fonction
void Mini(char* chaine, int n ) // fonc defini le numero de la fonction
{
short j;
drect(n*21+2, 56, n*21+20, 63, color_black);
drect(n*21+2, 56, n*21+20, 63, color_black);
dtext(n*21+strlen(chaine), 58, chaine);
dtext(n*21+strlen(chaine), 58, chaine);
//ML_display_vram();
}
int tableauElement(int chang)
{
short decalx=0,decaly=0;
short x,y;
short decalx=0, decaly=0;
short x, y;
short i;
@ -353,7 +232,7 @@ int tableauElement(int chang)
{
dclear();
chang=(chang>=118 ? 0 : chang<=-1 ? 117 : chang);
/*chang=(chang>=118 ? 0 : chang<=-1 ? 117 : chang);
decalx=-(((12*elements[chang].groupe)-13)*108)/240; // on fait un decalage lorsque l'on bouge
decaly=(elements[chang].periode==5 ? -7 : elements[chang].periode>5 ? -14 : 0);
@ -364,35 +243,35 @@ int tableauElement(int chang)
y=(i>55 && i<71 ? 9 : i>87 && i<103 ? 10 : elements[i].periode);
dtext(12*x+decalx-12,7*y+decaly-6,elements[i].symbol);
dtext(12*x+decalx-12, 7*y+decaly-6, elements[i].symbol);
dtext(12*3-11+decalx,7*6-7+decaly,"1");
dtext(12*3-11+decalx,7*7-7+decaly,"2");
dtext(12*3-11+decalx, 7*6-7+decaly, "1");
dtext(12*3-11+decalx, 7*7-7+decaly, "2");
dtext(12*3-11+decalx,7*9+decaly-5,"1");
dtext(12*3-11+decalx,7*10+decaly-5,"2");
dtext(12*3-11+decalx, 7*9+decaly-5, "1");
dtext(12*3-11+decalx, 7*10+decaly-5, "2");
}
if (chang>55 && chang<71)
{
drect(12*elements[chang].groupe-13+decalx,7*9-7+decaly,12*elements[chang].groupe-1+decalx,7*9+decaly,color_black);
drect(12*elements[chang].groupe-13+decalx, 7*9-7+decaly, 12*elements[chang].groupe-1+decalx, 7*9+decaly, color_black);
}
else if (chang>87 && chang<103)
{
drect(12*elements[chang].groupe-13+decalx,7*10-7+decaly,12*elements[chang].groupe-1+decalx,7*10+decaly,color_black);
drect(12*elements[chang].groupe-13+decalx, 7*10-7+decaly, 12*elements[chang].groupe-1+decalx, 7*10+decaly, color_black);
}
else
{
drect(12*elements[chang].groupe-13+decalx,7*elements[chang].periode-7+decaly,12*elements[chang].groupe+decalx,7*elements[chang].periode+decaly,color_black);
drect(12*elements[chang].groupe-13+decalx, 7*elements[chang].periode-7+decaly, 12*elements[chang].groupe+decalx, 7*elements[chang].periode+decaly, color_black);
}
drect(0,56,128,64,color_white); // on fait un rectangle blanc pour qu'il n'y ait rien
drect(0, 56, 128, 64, color_white); // on fait un rectangle blanc pour qu'il n'y ait rien
Mini("mini",0);
Mini("find",1);
Mini("mol",2);
Mini("mini", 0);
Mini("find", 1);
Mini("mol", 2);
Mini("det",5);
Mini("det", 5);
key=getkey();
@ -410,13 +289,13 @@ int tableauElement(int chang)
case KEY_F6 : case KEY_EXE : chang=detailsElement(chang); break;
case KEY_EXIT : return;
}
}*/
}
}
int tableauEleMini(int chang)
{
char buffer[50];
/*char buffer[50];
char y;
char menu=0;
char choix=-1;
@ -425,7 +304,7 @@ while(1)
{
dclear();
// ML_bmp_or(TABLEAU_MINI,0,0,91,48);
// ML_bmp_or(TABLEAU_MINI, 0, 0, 91, 48);
choix_famille(choix); // on met en place le choix sur les familles
chang=(chang>=118 ? 0 : chang<=-1 ? 117 : chang);
@ -434,33 +313,33 @@ while(1)
if (chang>55 && chang<71 || chang>87 && chang<103)
{
drect(5*elements[chang].groupe-4,5*y-7,5*elements[chang].groupe-1,5*y-4,color_black);
drect(5*elements[chang].groupe-4, 5*y-7, 5*elements[chang].groupe-1, 5*y-4, color_black);
}
else
{
drect(5*elements[chang].groupe-4,5*y-4,5*elements[chang].groupe-1,5*y-1,color_black);
drect(5*elements[chang].groupe-4, 5*y-4, 5*elements[chang].groupe-1, 5*y-1, color_black);
}
dtext(110-3*strlen(elements[chang].symbol),13,elements[chang].symbol);
dtext(110-3*strlen(elements[chang].symbol), 13, elements[chang].symbol);
sprintf(buffer,"%d",chang+1); // détail des éléments sur la droite
dtext(110-2*strlen(buffer),5,buffer);
sprintf(buffer, "%d", chang+1); // détail des éléments sur la droite
dtext(110-2*strlen(buffer), 5, buffer);
sprintf(buffer,"%.3f",elements[chang].masse_mol);
dtext(110-2*strlen(buffer),23,buffer);
sprintf(buffer, "%.3f", elements[chang].masse_mol);
dtext(110-2*strlen(buffer), 23, buffer);
if(menu==0)
{
Mini("maxi",0);
Mini("find",1);
Mini("mol",2);
Mini("maxi", 0);
Mini("find", 1);
Mini("mol", 2);
Mini("fami",4);
Mini("det",5);
Mini("fami", 4);
Mini("det", 5);
key=getkey();
@ -476,12 +355,12 @@ while(1)
}
else if (menu==1)
{
Mini("n-me",0);
Mini("halo",1);
Mini("g-ra",2);
Mini("m-ti",3);
Mini("m-al",4);
Mini(" -->",5);
Mini("n-me", 0);
Mini("halo", 1);
Mini("g-ra", 2);
Mini("m-ti", 3);
Mini("m-al", 4);
Mini(" -->", 5);
key=getkey();
@ -499,12 +378,12 @@ while(1)
}
else if (menu==2)
{
Mini("m-at",0);
Mini("lant",1);
Mini("acta",2);
Mini("m-tr",3);
Mini("p-tr",4);
Mini(" -->",5);
Mini("m-at", 0);
Mini("lant", 1);
Mini("acta", 2);
Mini("m-tr", 3);
Mini("p-tr", 4);
Mini(" -->", 5);
key=getkey();
@ -532,13 +411,13 @@ while(1)
case KEY_EXE : chang=detailsElement(chang); break;
}
}
}*/
}
void choix_famille(int choix)
{
/*
char i=0,y;
char i=0, y;
for(i;i<118;++i)
{
@ -546,10 +425,10 @@ char i=0,y;
{
y=(i>55 && i<71 ? 9 : i>87 && i<103 ? 10 : elements[i].periode);
(i>55 && i<71 || i>87 && i<103 ? ML_bmp_or(select,5*elements[i].groupe-4,5*y-7,4,4) : ML_bmp_or(select,5*elements[i].groupe-4,5*y-4,4,4));
(i>55 && i<71 || i>87 && i<103 ? ML_bmp_or(select, 5*elements[i].groupe-4, 5*y-7, 4, 4) : ML_bmp_or(select, 5*elements[i].groupe-4, 5*y-4, 4, 4));
ML_bmp_or(select,20,50,4,4);
dtext(30,50,family[choix]);
ML_bmp_or(select, 20, 50, 4, 4);
dtext(30, 50, family[choix]);
}
}*/
}
@ -564,72 +443,72 @@ while (1)
dclear();
dprint(20,descente+13,elements[a].symbol,0);
sprintf(buffer,"%s",elements[a].nom);
dtext(40,descente+13,buffer);
dprint(20, descente+13, elements[a].symbol, 0);
sprintf(buffer, "%s", elements[a].nom);
dtext(40, descente+13, buffer);
sprintf(buffer,"%d",a+1); // détail des éléments
dtext((10-a/25),descente+15,buffer);
sprintf(buffer, "%d", a+1); // détail des éléments
dtext((10-a/25), descente+15, buffer);
sprintf(buffer,"masse molaire %.3f g/mol",elements[a].masse_mol);
dtext(1,descente+23,buffer);
sprintf(buffer, "masse molaire %.3f g/mol", elements[a].masse_mol);
dtext(1, descente+23, buffer);
dtext(20,descente+40,"propriete de base :"); //
dtext(20, descente+40, "propriete de base :"); //
if (elements[a].groupe>=1)
/* if (elements[a].groupe>=1)
{
sprintf(buffer,"groupe : %d ",elements[a].groupe);
dtext(1,descente+50,buffer);
sprintf(buffer, "groupe : %d ", elements[a].groupe);
dtext(1, descente+50, buffer);
}
if ((a>55 && a<71) || (a>87 && a<103))
dtext(1,descente+50,"pas de groupe");
dtext(1, descente+50, "pas de groupe");
sprintf(buffer,"periode : %d ",elements[a].periode);
dtext(1,descente+60,buffer);
sprintf(buffer, "periode : %d ", elements[a].periode);
dtext(1, descente+60, buffer);
sprintf(buffer,"couch electro %s",elements[a].config_electro);
dtext(1,descente+70,buffer);
sprintf(buffer, "couch electro %s", elements[a].config_electro);
dtext(1, descente+70, buffer);
sprintf(buffer,"famille %s",family[ajout[a].famille]);
dtext(1,descente+80,buffer);
sprintf(buffer, "famille %s", family[ajout[a].famille]);
dtext(1, descente+80, buffer);
sprintf(buffer,"decouvert en %d",ajout[a].annee);
dtext(1,descente+90,buffer);
sprintf(buffer, "decouvert en %d", ajout[a].annee);
dtext(1, descente+90, buffer);
sprintf(buffer,"etat a 293.15 K : %s",etat[ajout[a].etat]);
dtext(1,descente+100,buffer);
sprintf(buffer, "etat a 293.15 K : %s", etat[ajout[a].etat]);
dtext(1, descente+100, buffer);
dtext(20,descente+120,"reactivite :"); //
dtext(20, descente+120, "reactivite :"); //
if (elements[a].electro_neg==0)
{
dtext(1,descente+130,"electro neg inconnue");
dtext(1, descente+130, "electro neg inconnue");
}
else
{
sprintf(buffer,"electro neg : %f ",elements[a].electro_neg);
dtext(1,descente+130,buffer);
sprintf(buffer, "electro neg : %f ", elements[a].electro_neg);
dtext(1, descente+130, buffer);
}
if (elements[a].valence>=0)
{
sprintf(buffer,"valence : %d ",elements[a].valence);
dtext(1,descente+140,buffer);
sprintf(buffer, "valence : %d ", elements[a].valence);
dtext(1, descente+140, buffer);
}
else
{
dtext(1,descente+140,"valence inconnue");
dtext(1, descente+140, "valence inconnue");
}
Mini("ret",5);
Mini("ret", 5);*/
key=getkey();
switch (key)
{
case KEY_RIGHT : a-=1,descente=-9; break;
case KEY_LEFT : a+=1,descente=-9; break;
case KEY_RIGHT : a-=1, descente=-9; break;
case KEY_LEFT : a+=1, descente=-9; break;
case KEY_DOWN : descente-=4; break;
case KEY_UP : descente+=4; break;
case KEY_F6 : case KEY_EXE : case KEY_EXIT : return a;
@ -644,25 +523,25 @@ int find(chang)
{/*
char *numero=NULL;
char i=0,j;
char i=0, j;
const char buffer[50];
Bdisp_AllClr_DDVRAM();
dtext(10,1,"Vous cherchez :");
dtext(10,15,"1. numero de l'element");
dtext(10,25,"2. masse molaire");
dtext(10,35,"3. Symbole de l'element");
dtext(10,45,"4. Nom de l'element");
dtext(10, 1, "Vous cherchez :");
dtext(10, 15, "1. numero de l'element");
dtext(10, 25, "2. masse molaire");
dtext(10, 35, "3. Symbole de l'element");
dtext(10, 45, "4. Nom de l'element");
while (1)
{
EI_init();
EI_manage_config(EI_SET_COLUMN, 1);
EI_manage_config(EI_SET_ROW, 3);
EI_manage_config(EI_SET_START_MODE, EI_NORMAL);
EI_manage_config(EI_SET_COLUMN, 1);
EI_manage_config(EI_SET_ROW, 3);
EI_manage_config(EI_SET_START_MODE, EI_NORMAL);
GetKey(&key);
@ -673,9 +552,9 @@ while (1)
while(1)
{
Bdisp_AllClr_DDVRAM();
dtext(1,1,"Vous cherchez l'element n :");
dtext(1, 1, "Vous cherchez l'element n :");
numero=EI_input_string(3,(const char*)"0123456789");
numero=EI_input_string(3, (const char*)"0123456789");
// ça coupe ici
if (atoi(numero)>0 && atoi(numero)<119) // ça arrête le curseur
{
@ -689,10 +568,10 @@ while (1)
while(1)
{
Bdisp_AllClr_DDVRAM();
dtext(1,1,"Vous cherchez une masse");
dtext(1,7,"molaire de :");
dtext(1, 1, "Vous cherchez une masse");
dtext(1, 7, "molaire de :");
numero=EI_input_string(3,(const char*)"0123456789");
numero=EI_input_string(3, (const char*)"0123456789");
for (i=0;i<118;i++)
{
@ -709,11 +588,11 @@ while (1)
while(1)
{
Bdisp_AllClr_DDVRAM();
dtext(1,1,"Vous cherchez le symbole ?",0);
dtext(1, 1, "Vous cherchez le symbole ?", 0);
EI_manage_config(EI_SET_START_MODE, EI_ALPHA_LOCKED);
EI_manage_config(EI_SET_START_MODE, EI_ALPHA_LOCKED);
numero=EI_input_string(3,(const char*)"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz");
numero=EI_input_string(3, (const char*)"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz");
numero[0]=toupper (numero[0]); // on met le 1er caractère en majuscule
for (i=0;i<118;i++)
{
@ -722,7 +601,7 @@ while (1)
numero[j] = tolower(numero[j]); // on met certains caractères en minuscule pour la recherche
}
if (!strcmp(numero,elements[i].symbol))
if (!strcmp(numero, elements[i].symbol))
{
return i;
}
@ -735,11 +614,11 @@ while (1)
while(1)
{
Bdisp_AllClr_DDVRAM();
dtext(1,1,"Vous cherchez le nom ?",0);
dtext(1, 1, "Vous cherchez le nom ?", 0);
EI_manage_config(EI_SET_START_MODE, EI_ALPHA_LOCKED);
EI_manage_config(EI_SET_START_MODE, EI_ALPHA_LOCKED);
numero=EI_input_string(13,(const char*)"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz");
numero=EI_input_string(13, (const char*)"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz");
numero[0]=toupper(numero[0]); // on met le 1er caractère en majuscule
for (i=0;i<118;i++)
{
@ -748,7 +627,7 @@ while (1)
numero[j] = tolower(numero[j]);// on met certains caractères en minuscule pour la recherche
}
if (!strcmp(numero,elements[i].nom))
if (!strcmp(numero, elements[i].nom))
{
return i;
}
@ -764,10 +643,10 @@ while (1)
void calcul_mole()
{/*
char *str = NULL, *p=str;
char *str = NULL, *p=str;
char characts[20]={'\0'};
char i=0;
float result=0, masse;
float result=0, masse;
const char buffer[50]={0};
char cap;
@ -775,22 +654,22 @@ while(1)
{
Bdisp_AllClr_DDVRAM();
dtext(1,1,"Entrez votre formule : ");
dtext(1, 1, "Entrez votre formule : ");
Mini("A a",0);
Mini("A a", 0);
EI_init();
EI_manage_config(EI_SET_COLUMN, 1);
EI_manage_config(EI_SET_ROW, 2);
EI_manage_config(EI_SET_START_MODE, EI_NORMAL);
EI_manage_config(EI_SET_COLUMN, 1);
EI_manage_config(EI_SET_ROW, 2);
EI_manage_config(EI_SET_START_MODE, EI_NORMAL);
str=EI_input_string(25,(const char*)"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz");
str=EI_input_string(25, (const char*)"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz");
Bdisp_AllClr_DDVRAM();
sprintf(buffer,"%s",str);
PrintXY(64-3*strlen(str),10,buffer,36);
sprintf(buffer, "%s", str);
PrintXY(64-3*strlen(str), 10, buffer, 36);
while(*str) // on va jusqu'a la fin de la chaine
{
@ -807,7 +686,7 @@ while(*str) // on va jusqu'a la fin de la chaine
for(i=0;i<118;i++) // on se déplace dans les éléments de la structure
{
if(!strcmp(characts,elements[i].symbol))
if(!strcmp(characts, elements[i].symbol))
{
masse=elements[i].masse_mol; // on a la masse molaire
break;
@ -834,13 +713,13 @@ while(*str) // on va jusqu'a la fin de la chaine
free(p);
dtext(1,30,"la masse molaire est de");
dtext(1, 30, "la masse molaire est de");
sprintf(buffer,"%.3f g/mol",result);
dtext(1,40,buffer);
sprintf(buffer, "%.3f g/mol", result);
dtext(1, 40, buffer);
Mini("calc",0);
Mini("ret",5);
Mini("calc", 0);
Mini("ret", 5);
result=0;