🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: fr.comp.lang.c
Article #15315

Re: rot13 [Was : Re: conjugaison et autres ...]

#15315
From: candide
Date: Sun, 02 Oct 2005 09:31
34 lines
2323 bytes
"Emmanuel Delahaye" <emdel@YOURBRAnoos.fr> wrote in
news:mn.128c7d5aa5238de0.15512@YOURBRAnoos.fr: 

> candide wrote on 02/10/05 :
>> Effectivement, je me rends compte (google) qu'il n'y a pas que le
>> codage ascii. Ceci convient-il :
>>
>> if (s[i] >= 'a' && s[i] <= 'z')
>>                s[i] = 'a'+(s[i]-'a'+13)%26;
>> if (s[i] >= 'A' && s[i] <= 'Z')
>>                s[i] = 'A'+(s[i]-'A'+13)%26;
> 
> Non, car il n'y a aucune garantie que les valeurs soient cons�cutives 

En effet, j'�tais parti de ce postulat.


> (� part pour 0-9, mais qui, � ma connaisance, n'est pas concern� par 
> ROT-13)
> 
> Lid�e est de cr�er 2 tables avec tous les caract�res (A-Z) et (a-z),
> et de chercher dedans la position 'i' du caract�re avec strchr().
> Ensuite, on va chercher le caract�re � (i + 13) % 26...
> 
> Pour chercher dans la bonne table, on utilise les filtres isprint(), 
> isnum(), ispunct(), isupper() (<ctype.h>) etc. Jamais la valeur des 
> caract�res.


OK merci � toi ainsi qu'� Pierre Maurette, je regarderai avec int�r�t vos 
suggestions.


Candide
Technical Details
Message-ID: <433fa8d4$0$7845$8fcfb975@news.wanadoo.fr>
Path: arc1-ca.pugleaf.net!g2news1.google.com!news2.google.com!newsread.com!news-xfer.newsread.com!newspeer.monmouth.com!newsfeed.icl.net!newsfeed.fjserv.net!oleane.net!oleane!freenix!news.wanadoo.fr!news.wanadoo.fr!not-for-mail
References: <1126342327.583568.21420@g43g2000cwa.googlegroups.com> <4329e5d4$0$7846$8fcfb975@news.wanadoo.fr> <dge4b6$fqa$1@reader1.imaginet.fr> <432ab809$0$1734$8fcfb975@news.wanadoo.fr> <mn.84b07d59016a857b.31483@laposte.net> <433f16ac$0$27406$8fcfb975@news.wanadoo.fr> <mn.10907d5a55119e84.15512@YOURBRAnoos.fr> <433f9cb1$0$7821$8fcfb975@news.wanadoo.fr> <mn.128c7d5aa5238de0.15512@YOURBRAnoos.fr>

Show Full Headers
Complete Article Headers
X-Google-Thread: f9822,b21b26167a936e28
X-Google-Attributes: gidf9822,public
X-Google-Language: FRENCH,ASCII
Path: arc1-ca.pugleaf.net!g2news1.google.com!news2.google.com!newsread.com!news-xfer.newsread.com!newspeer.monmouth.com!newsfeed.icl.net!newsfeed.fjserv.net!oleane.net!oleane!freenix!news.wanadoo.fr!news.wanadoo.fr!not-for-mail
Newsgroups: fr.comp.lang.c
Subject: Re: rot13 [Was : Re: conjugaison et autres ...]
From: candide <candide@domain.invalid>
References: <1126342327.583568.21420@g43g2000cwa.googlegroups.com> <4329e5d4$0$7846$8fcfb975@news.wanadoo.fr> <dge4b6$fqa$1@reader1.imaginet.fr> <432ab809$0$1734$8fcfb975@news.wanadoo.fr> <mn.84b07d59016a857b.31483@laposte.net> <433f16ac$0$27406$8fcfb975@news.wanadoo.fr> <mn.10907d5a55119e84.15512@YOURBRAnoos.fr> <433f9cb1$0$7821$8fcfb975@news.wanadoo.fr> <mn.128c7d5aa5238de0.15512@YOURBRAnoos.fr>
User-Agent: Xnews/5.04.25
Date: 02 Oct 2005 09:31:00 GMT
Lines: 34
Message-ID: <433fa8d4$0$7845$8fcfb975@news.wanadoo.fr>
Organization: les newsgroups par Wanadoo
NNTP-Posting-Date: 02 Oct 2005 11:31:00 CEST
NNTP-Posting-Host: 81.250.26.83
X-Trace: 1128245460 news.wanadoo.fr 7845 81.250.26.83:1493
X-Complaints-To: abuse@wanadoo.fr