Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

Turing is retarded.

Name: Anonymous 2011-11-05 22:15

The following loops forever:

int main(){
while(1);
return 0;
}


The following does not:

int main(){
return 0;
}


Me: 1
Turing: 0

Name: Anonymous 2011-11-06 0:58

ok so write two functions then:

* int run(int code, int value) which runs a program with code code and input value value and produces its return value
* int halts(int code, int value) which returns 1if the program with code code and input value value halts, and 0 otherwise.

now let liarcode be the number expressing the following program:


int liar(int liarcode) {
 if(!halts(liar(liarcode))) { return 1; } else { while(1) {} }
}


and tell me what does your function give for halts(liarcode,liarcode)?

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List