Accueil > Forum > > > > TradAion
TradAion
dimanche 21 mars 2010 à 04:10:49 |
TradAion

shootangel
|
Bonjour,
Voila j'ai un projet mais je ne sais pas comment mis prendre c'est pour cela que je m'adresse a vous programmeurs....
j'aimerais apprendre ou savoir comment faire un traducteur de langue.
enfaite je sais cela:
Elyséen: a b c d e f g h i j k l m n o p q r s t u v w x y z Asmodien: i h k j m l o n q p s r u t w v y x a z c b e d g f
C'est a dire que quand un élyséen dit "stop" un asmodien reçois "azwv"
voilu, merci et a bientôt
|
|
dimanche 21 mars 2010 à 17:39:20 |
Re : TradAion

rt15
|
Bonjour,
Travaille avec les caractères comme avec des entiers.
Fait un tableau de char asmodien contenant i h k j m l o n q p s r u t w v y x a z c b e d g f.
asmodien[26] = { 'i', 'h', ... };
Et ensuite, quelque chose comme ça ->
Code : i = 0;
tant que tab[i] faire
si (tab[i] >= 'a') et (tab[i] <= 'z') alors
tab[i] = asmodien[tab[i] - 'a'];
fsi;
i++;
fait;
|
|
dimanche 21 mars 2010 à 18:45:33 |
Re : TradAion

shootangel
|
Donc la deuxième c'est
i = 0;
tant que tab[i] faire
si (tab[i] >= 'b') et (tab[i] <= 'h') alors
tab[i] = asmodien[tab[i] - 'b'];
fsi;
i++;
fait;
ou
b = 0;
tant que tab[b] faire
si (tab[b] >= 'h') et (tab[b] <= 'z') alors
tab[b] = asmodien[tab[b] - 'h'];
fsi;
i++;
fait;
|
|
dimanche 21 mars 2010 à 19:45:33 |
Re : TradAion

rt15
|
Non non. Ca fait toutes les lettres en une passe.
Code C/C++ : tab[i] = asmodien[tab[i] - 'a'];
Si c'est un tab[i] est un "e" par exemple...
->
tab[i] = asmodien['e' - 'a'];
Table ascii...
->
tab[i] = asmodien[101 - 97];
->
tab[i] = asmodien[4];
Les tableaux C sont indicés de 0 à n - 1...
->
tab[i] = 'm';
Et ainsi de suite pour toutes les lettre de tab qui sont des lettres entre a et z jusqu'au zéro terminal (On avance avec le i++). Attention, les majuscules ne sont pas traitées par contre.
|
|
lundi 22 mars 2010 à 12:35:32 |
Re : TradAion

shootangel
|
tableau de char asmodien
asmodien[26] = { 'i', 'h', 'k', 'j', 'm', 'l', 'o', 'n', 'q', 'p', 's', 'r', 'u', 't', 'w', 'v', 'y', 'x', 'a', 'z', 'c', 'b', 'e', 'd', 'g', 'f', };
tableau de char elyséen
elyséen[26] = { 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z', };
tab[i] = asmodien[tab[i] - 'a'];
tab[i] = asmodien[tab[h] - 'b'];
tab[i] = asmodien[tab[k] - 'c'];
tab[i] = asmodien[tab[j] - 'd'];
tab[i] = asmodien[tab[m] - 'e'];
tab[i] = asmodien[tab[l] - 'f'];
tab[i] = asmodien[tab[o] - 'g'];
tab[i] = asmodien[tab[n] - 'h'];
tab[i] = asmodien[tab[q] - 'i'];
tab[i] = asmodien[tab[p] - 'j'];
tab[i] = asmodien[tab[s] - 'k'];
tab[i] = asmodien[tab[r] - 'l'];
tab[i] = asmodien[tab[u] - 'm'];
tab[i] = asmodien[tab[t] - 'n'];
tab[i] = asmodien[tab[w] - 'o'];
tab[i] = asmodien[tab[v] - 'p'];
tab[i] = asmodien[tab[y] - 'q'];
tab[i] = asmodien[tab[x] - 'r'];
tab[i] = asmodien[tab[c] - 's'];
tab[i] = asmodien[tab[z] - 't'];
tab[i] = asmodien[tab[c] - 'u'];
tab[i] = asmodien[tab[b] - 'v'];
tab[i] = asmodien[tab[e] - 'w'];
tab[i] = asmodien[tab[d] - 'x'];
tab[i] = asmodien[tab[g] - 'y'];
tab[i] = asmodien[tab[f] - 'z'];
comme cela ?
|
|
lundi 22 mars 2010 à 14:34:49 |
Re : TradAion

rt15
|
Heu...
Il ne faut pas écrire du code au hasard. Il faut commencer par une étape de conception. Dans cet étape, il faut avant tout réfléchir, poser le problème et trouver un algo le solutionnant. Ensuite on code.
Autre point important, le développeur n'aime pas travailler. Il laisse faire l'ordinateur. Donc quand on fait un code, on le fait dense et sans répétitions. Si tu appuis sur ctrl + C et ctrl + V lorsque tu code c'est qu'il y a un problème dans ton algo. Faut faire une fonction ou une boucle.
Code C/C++ : #include <stdio.h>
char asmodien[26] = { 'i', 'h', 'k', 'j', 'm', 'l', 'o', 'n', 'q', 'p', 's', 'r', 'u', 't', 'w', 'v', 'y', 'x', 'a', 'z', 'c', 'b', 'e', 'd', 'g', 'f' };
int main ()
{
char tab[200];
int i;
gets(tab);
i = 0;
while (tab[i])
{
if ((tab[i] >= 'a') && (tab[i] <= 'z'))
tab[i] = asmodien[tab[i] - 'a'];
i++;
}
puts(tab);
return 0;
}
|
|
mardi 23 mars 2010 à 13:18:47 |
Re : TradAion

shootangel
|
DONC
#include <stdio.h>
char asmodien[26] = { 'i', 'h', 'k', 'j', 'm', 'l', 'o', 'n', 'q', 'p', 's', 'r', 'u', 't', 'w', 'v', 'y', 'x', 'a', 'z', 'c', 'b', 'e', 'd', 'g', 'f' };
int main ()
{
char tab[200];
int i;
gets(tab);
i = 0;
while (tab[i])
{
if ((tab[i] >= 'a') && (tab[i] <= 'z'))
tab[i] = asmodien[tab[i] - 'a'];
i++;
}
puts(tab);
return 0;
}
#include <stdio.h>
char elyséen[26] = { 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z', };
int main ()
{
char tab[200];
int i;
gets(tab);
i = 0;
while (tab[i])
{
if ((tab[i] >= 'a') && (tab[i] <= 'z'))
tab[i] = asmodien[tab[i] - 'a'];
i++;
}
puts(tab);
return 0;
}
|
|
Cette discussion est classée dans : tradaion, asmodien
Répondre à ce message
Sujets en rapport avec ce message
Livres en rapport
|
Derniers Blogs
[WP7] DYNAMICALLY CHANGE STARTUP PAGE[WP7] DYNAMICALLY CHANGE STARTUP PAGE par KooKiz
Let's say that you want to allow the user to customize the startup page of your application. You can easily change the startup page by editing the 'NavigationPage' attribute in the manifest file. But the manifest cannot be modified once the applicatio...
Cliquez pour lire la suite de l'article par KooKiz SESSION SILVERLIGHT 5 3D : SLIDES ET DEMOSSESSION SILVERLIGHT 5 3D : SLIDES ET DEMOS par Groc
Durant les techdays, j'ai eu le plaisir d'animer une session sur Silverlight 5 et la 3D avec Simon Ferquel. Comme promis, voici nos slides et mes démos (celles avec le viper BSG) ici et là. Pour mémoire, les démos utilisent toutes le viper BSG...
Cliquez pour lire la suite de l'article par Groc [TECHDAYS 2012] SESSION WEBMATRIX 2 : LE COUTEAU SUISSE GRATUIT POUR VOS DéVELOPPEMENTS WEB - SLIDES[TECHDAYS 2012] SESSION WEBMATRIX 2 : LE COUTEAU SUISSE GRATUIT POUR VOS DéVELOPPEMENTS WEB - SLIDES par gpommier
Suite à la session que j'ai présenté sur WebMatrix 2, vous pouvez trouver les slides ici, ainsi que les démos en packages nuget : démos1 et démos2 J'en profite pour remercier chaleureusement tous ceux qui sont venus très nombreux à cette sess...
Cliquez pour lire la suite de l'article par gpommier [SHAREPOINT] LES SESSIONS TECHDAYS 2012.[SHAREPOINT] LES SESSIONS TECHDAYS 2012. par Patrick Guimonet
Voici donc pour ceux qui n'ont pas pu venir, ou ceux qui n'ont pas pu toutes les suivre la liste des sessions SharePoint aux TechDays 2012, que je mettrais à jour dès que les liens des vidéo seront disponibles. Ou ici : http...
Cliquez pour lire la suite de l'article par Patrick Guimonet TECHDAYS PARIS 2012 : SESSION PLEINIèRE JOUR 3TECHDAYS PARIS 2012 : SESSION PLEINIèRE JOUR 3 par ROMELARD Fabrice
Speaker: Bernard Ourghanlian Cette session est comme chaque jour transmise en live par BrainSonic, et j'ai donc suivi cette troisième pleinière par ce moyen sur mon iPad . Elle est dédiée comme chaque année à la mise en perspective de l'é...
Cliquez pour lire la suite de l'article par ROMELARD Fabrice
Logiciels
Tribler (2012)TRIBLER (2012)Tribler est un client pair à pair (P2P/Peer-to-Peer) open source avec la capacité de regarder des... Cliquez pour télécharger Tribler OneSwarm (2012)ONESWARM (2012)Le peer-to-peer qui protège votre vie privée, c'est OneSwarm.
Ce logiciel de peer-to-peer crypté... Cliquez pour télécharger OneSwarm PONAMEDIA PREMIUM - HELLLOOO FLASH DEMO (V8.4)PONAMEDIA PREMIUM - HELLLOOO FLASH DEMO (V8.4)PONAMEDIA TV DEVIENS HELLLOOO FLASH
LA TV SUR VOTRE ORDINATEUR.
Toute une plateforme Multi... Cliquez pour télécharger PONAMEDIA PREMIUM - HELLLOOO FLASH DEMO Academy System (17.2.1.0)ACADEMY SYSTEM (17.2.1.0)Logiciel de gestion des établissements.
- élèves/étudiants (inscription, dossier, absence...)
-... Cliquez pour télécharger Academy System Easy-Planning (1.0.0.1)EASY-PLANNING (1.0.0.1)Basé sur les mêmes principes que MyPlanning, Easy-Planning permet de créer des plannings sous la ... Cliquez pour télécharger Easy-Planning
|