annotate run/bug_20041103_A.d @ 1559:ec5e144583ea

D1 -> D2 : 1/N
author thomask
date Sun, 19 Aug 2007 19:11:54 +0000
parents 52c9e86b6486
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
140
a33ad7189d21 1) news:// -> news:
thomask
parents: 98
diff changeset
1 // $HeadURL$
a33ad7189d21 1) news:// -> news:
thomask
parents: 98
diff changeset
2 // $Date$
a33ad7189d21 1) news:// -> news:
thomask
parents: 98
diff changeset
3 // $Author$
a33ad7189d21 1) news:// -> news:
thomask
parents: 98
diff changeset
4
98
75e0c2f6231e kinghajj <kinghajj_member@pathlink.com> news://cm98hu$e30$1@digitaldaemon.com nttp://digitalmars.com/digitalmars.D:12248
thomask
parents:
diff changeset
5 // @author@ kinghajj <kinghajj_member@pathlink.com>
75e0c2f6231e kinghajj <kinghajj_member@pathlink.com> news://cm98hu$e30$1@digitaldaemon.com nttp://digitalmars.com/digitalmars.D:12248
thomask
parents:
diff changeset
6 // @date@ 2004-10-03
140
a33ad7189d21 1) news:// -> news:
thomask
parents: 98
diff changeset
7 // @uri@ news:cm98hu$e30$1@digitaldaemon.com
1383
52c9e86b6486 @url@ -> @uri@
thomask
parents: 140
diff changeset
8 // @uri@ nntp://digitalmars.com/digitalmars.D/12248
98
75e0c2f6231e kinghajj <kinghajj_member@pathlink.com> news://cm98hu$e30$1@digitaldaemon.com nttp://digitalmars.com/digitalmars.D:12248
thomask
parents:
diff changeset
9
75e0c2f6231e kinghajj <kinghajj_member@pathlink.com> news://cm98hu$e30$1@digitaldaemon.com nttp://digitalmars.com/digitalmars.D:12248
thomask
parents:
diff changeset
10 module dstress.run.bug_20041103_A;
75e0c2f6231e kinghajj <kinghajj_member@pathlink.com> news://cm98hu$e30$1@digitaldaemon.com nttp://digitalmars.com/digitalmars.D:12248
thomask
parents:
diff changeset
11
1559
ec5e144583ea D1 -> D2 : 1/N
thomask
parents: 1383
diff changeset
12 char rot13_c(char ret){
98
75e0c2f6231e kinghajj <kinghajj_member@pathlink.com> news://cm98hu$e30$1@digitaldaemon.com nttp://digitalmars.com/digitalmars.D:12248
thomask
parents:
diff changeset
13 if(ret > 'A'-1 && ret < 'N'){
75e0c2f6231e kinghajj <kinghajj_member@pathlink.com> news://cm98hu$e30$1@digitaldaemon.com nttp://digitalmars.com/digitalmars.D:12248
thomask
parents:
diff changeset
14 ret += 13;
75e0c2f6231e kinghajj <kinghajj_member@pathlink.com> news://cm98hu$e30$1@digitaldaemon.com nttp://digitalmars.com/digitalmars.D:12248
thomask
parents:
diff changeset
15 }else if(ret > 'M' && ret < 'Z'+1){
75e0c2f6231e kinghajj <kinghajj_member@pathlink.com> news://cm98hu$e30$1@digitaldaemon.com nttp://digitalmars.com/digitalmars.D:12248
thomask
parents:
diff changeset
16 ret -= 13;
75e0c2f6231e kinghajj <kinghajj_member@pathlink.com> news://cm98hu$e30$1@digitaldaemon.com nttp://digitalmars.com/digitalmars.D:12248
thomask
parents:
diff changeset
17 }else if(ret > 'a'-1 && ret < 'n'){
75e0c2f6231e kinghajj <kinghajj_member@pathlink.com> news://cm98hu$e30$1@digitaldaemon.com nttp://digitalmars.com/digitalmars.D:12248
thomask
parents:
diff changeset
18 ret += 13;
75e0c2f6231e kinghajj <kinghajj_member@pathlink.com> news://cm98hu$e30$1@digitaldaemon.com nttp://digitalmars.com/digitalmars.D:12248
thomask
parents:
diff changeset
19 }else if(ret > 'm' && ret < 'z'+1){
75e0c2f6231e kinghajj <kinghajj_member@pathlink.com> news://cm98hu$e30$1@digitaldaemon.com nttp://digitalmars.com/digitalmars.D:12248
thomask
parents:
diff changeset
20 ret -= 13;
75e0c2f6231e kinghajj <kinghajj_member@pathlink.com> news://cm98hu$e30$1@digitaldaemon.com nttp://digitalmars.com/digitalmars.D:12248
thomask
parents:
diff changeset
21 }
75e0c2f6231e kinghajj <kinghajj_member@pathlink.com> news://cm98hu$e30$1@digitaldaemon.com nttp://digitalmars.com/digitalmars.D:12248
thomask
parents:
diff changeset
22 return ret;
75e0c2f6231e kinghajj <kinghajj_member@pathlink.com> news://cm98hu$e30$1@digitaldaemon.com nttp://digitalmars.com/digitalmars.D:12248
thomask
parents:
diff changeset
23 }
75e0c2f6231e kinghajj <kinghajj_member@pathlink.com> news://cm98hu$e30$1@digitaldaemon.com nttp://digitalmars.com/digitalmars.D:12248
thomask
parents:
diff changeset
24
75e0c2f6231e kinghajj <kinghajj_member@pathlink.com> news://cm98hu$e30$1@digitaldaemon.com nttp://digitalmars.com/digitalmars.D:12248
thomask
parents:
diff changeset
25 int main(){
75e0c2f6231e kinghajj <kinghajj_member@pathlink.com> news://cm98hu$e30$1@digitaldaemon.com nttp://digitalmars.com/digitalmars.D:12248
thomask
parents:
diff changeset
26 char c = rot13_c('A');
1559
ec5e144583ea D1 -> D2 : 1/N
thomask
parents: 1383
diff changeset
27 if('A'+13 != c){
ec5e144583ea D1 -> D2 : 1/N
thomask
parents: 1383
diff changeset
28 assert(0);
ec5e144583ea D1 -> D2 : 1/N
thomask
parents: 1383
diff changeset
29 }
98
75e0c2f6231e kinghajj <kinghajj_member@pathlink.com> news://cm98hu$e30$1@digitaldaemon.com nttp://digitalmars.com/digitalmars.D:12248
thomask
parents:
diff changeset
30 return 0;
75e0c2f6231e kinghajj <kinghajj_member@pathlink.com> news://cm98hu$e30$1@digitaldaemon.com nttp://digitalmars.com/digitalmars.D:12248
thomask
parents:
diff changeset
31 }