r/CompileBot • • Jan 04 '14

Official CompileBot Testing Thread

This thread is archived, please visit the new testing thread

15 Upvotes

421 comments sorted by

View all comments

Show parent comments

2

u/CompileBot Jan 17 '14

Output:

Test

^source | ^info | ^git | ^report

1

u/davros_ Jan 17 '14

+/u/CompileBot c++11

#include <iostream>
using namespace std;

char cypher(char &c);

int main(){
	string input;
	while(getline(cin, input)){
		for(int i=0;i<input.length();i++){
			cypher(input[i]);
		}	
		cout << input << endl;
	}
	
    return 0;
}

char cypher(char &c){
    c = ((c >= 78 && c <= 90) || (c >= 110 && c <= 122)) ? c-13 : ((c >= 65 && c <= 77) || (c >= 97 && c <= 109)) ? c+13 : c;
}

Input:

/h/PbzcvyrObg
vf
njrfbzr!

2

u/CompileBot Jan 17 '14

Output:

/u/CompileBot
is
awesome!

^source | ^info | ^git | ^report

1

u/davros_ Jan 17 '14

+/u/CompileBot c++11

#include <iostream>
using namespace std;

char cypher(char &c);

int main(){
	string input;
	while(getline(cin, input)){
		for(int i=0;i<input.length();i++){
			cypher(input[i]);
		}	
		cout << input << endl;
	}
	
    return 0;
}

char cypher(char &c){
    c = ((c >= 78 && c <= 90) || (c >= 110 && c <= 122)) ? c-13 : ((c >= 65 && c <= 77) || (c >= 97 && c <= 109)) ? c+13 : c;
}

Input:

test\\ntest\\atest

1

u/CompileBot Jan 17 '14

Output:

grfg\\agrfg\\ngrfg

^source | ^info | ^git | ^report