annotate run/bug_20041103_D.d @ 98:75e0c2f6231e

kinghajj <kinghajj_member@pathlink.com> news://cm98hu$e30$1@digitaldaemon.com nttp://digitalmars.com/digitalmars.D:12248
author thomask
date Wed, 03 Nov 2004 09:17:24 +0000
parents
children a33ad7189d21
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
98
75e0c2f6231e kinghajj <kinghajj_member@pathlink.com> news://cm98hu$e30$1@digitaldaemon.com nttp://digitalmars.com/digitalmars.D:12248
thomask
parents:
diff changeset
1 // @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
2 // @date@ 2004-10-03
75e0c2f6231e kinghajj <kinghajj_member@pathlink.com> news://cm98hu$e30$1@digitaldaemon.com nttp://digitalmars.com/digitalmars.D:12248
thomask
parents:
diff changeset
3 // @uri@ news://cm98hu$e30$1@digitaldaemon.com
75e0c2f6231e kinghajj <kinghajj_member@pathlink.com> news://cm98hu$e30$1@digitaldaemon.com nttp://digitalmars.com/digitalmars.D:12248
thomask
parents:
diff changeset
4 // @url@ nttp://digitalmars.com/digitalmars.D:12248
75e0c2f6231e kinghajj <kinghajj_member@pathlink.com> news://cm98hu$e30$1@digitaldaemon.com nttp://digitalmars.com/digitalmars.D:12248
thomask
parents:
diff changeset
5
75e0c2f6231e kinghajj <kinghajj_member@pathlink.com> news://cm98hu$e30$1@digitaldaemon.com nttp://digitalmars.com/digitalmars.D:12248
thomask
parents:
diff changeset
6 module dstress.run.bug_20041103_D;
75e0c2f6231e kinghajj <kinghajj_member@pathlink.com> news://cm98hu$e30$1@digitaldaemon.com nttp://digitalmars.com/digitalmars.D:12248
thomask
parents:
diff changeset
7
75e0c2f6231e kinghajj <kinghajj_member@pathlink.com> news://cm98hu$e30$1@digitaldaemon.com nttp://digitalmars.com/digitalmars.D:12248
thomask
parents:
diff changeset
8 int rot13_c(in int ret){
75e0c2f6231e kinghajj <kinghajj_member@pathlink.com> news://cm98hu$e30$1@digitaldaemon.com nttp://digitalmars.com/digitalmars.D:12248
thomask
parents:
diff changeset
9 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
10 ret += 13;
75e0c2f6231e kinghajj <kinghajj_member@pathlink.com> news://cm98hu$e30$1@digitaldaemon.com nttp://digitalmars.com/digitalmars.D:12248
thomask
parents:
diff changeset
11 }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
12 ret -= 13;
75e0c2f6231e kinghajj <kinghajj_member@pathlink.com> news://cm98hu$e30$1@digitaldaemon.com nttp://digitalmars.com/digitalmars.D:12248
thomask
parents:
diff changeset
13 }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
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 }
75e0c2f6231e kinghajj <kinghajj_member@pathlink.com> news://cm98hu$e30$1@digitaldaemon.com nttp://digitalmars.com/digitalmars.D:12248
thomask
parents:
diff changeset
18 return ret;
75e0c2f6231e kinghajj <kinghajj_member@pathlink.com> news://cm98hu$e30$1@digitaldaemon.com nttp://digitalmars.com/digitalmars.D:12248
thomask
parents:
diff changeset
19 }
75e0c2f6231e kinghajj <kinghajj_member@pathlink.com> news://cm98hu$e30$1@digitaldaemon.com nttp://digitalmars.com/digitalmars.D:12248
thomask
parents:
diff changeset
20
75e0c2f6231e kinghajj <kinghajj_member@pathlink.com> news://cm98hu$e30$1@digitaldaemon.com nttp://digitalmars.com/digitalmars.D:12248
thomask
parents:
diff changeset
21 int main(){
75e0c2f6231e kinghajj <kinghajj_member@pathlink.com> news://cm98hu$e30$1@digitaldaemon.com nttp://digitalmars.com/digitalmars.D:12248
thomask
parents:
diff changeset
22 int c = rot13_c('A');
75e0c2f6231e kinghajj <kinghajj_member@pathlink.com> news://cm98hu$e30$1@digitaldaemon.com nttp://digitalmars.com/digitalmars.D:12248
thomask
parents:
diff changeset
23 assert(c=='A'+13);
75e0c2f6231e kinghajj <kinghajj_member@pathlink.com> news://cm98hu$e30$1@digitaldaemon.com nttp://digitalmars.com/digitalmars.D:12248
thomask
parents:
diff changeset
24 return 0;
75e0c2f6231e kinghajj <kinghajj_member@pathlink.com> news://cm98hu$e30$1@digitaldaemon.com nttp://digitalmars.com/digitalmars.D:12248
thomask
parents:
diff changeset
25 }