Welcome, Guest. Please login or register.
Did you miss your activation email?
May 23, 2017, 09:49:12 AM
Home Help Search chat Login Register 
News: Read this please.The Great Kangaroo Escape Looking for reviews of the 4th ed on Amazon!   Twitter:  @skochan

+ Official Forum for Programming in Objective-C (the iPhone Programming Language) - Stephen Kochan
|-+ Old Stuff
| |-+ Chapter Study
| | |-+ Chapter 2 - Programming in Objective-C
| | | |-+ Mind reading program
Pages: [1] Go Down
Author Topic: Mind reading program (Read 1781 times)
Posts: 3

on: November 23, 2010, 01:44:58 AM

here a funny example that came to my mind

#import <Foundation/Foundation.h>

int main (int argc, const char * argv[]) {
    NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init];

    NSLog(@"\n Lets play a game..\n I will figure a number you are thinking of...\n First choose a number\n Square it \n Add the result to your original number \n Divide by your original number. \n Add a number, how about 17. \n Subtract your original number. \n Divide by 6 \n The number you are thinking of now is 3!");

    [pool drain];
    return 0;

2010-11-23 10:46:49.459 Mind Reading program[4469:a0f]
 Lets play a game..
 I will figure a number you are thinking of...
 First choose a number
 Square it
 Add the result to your original number
 Divide by your original number.
 Add a number, how about 17.
 Subtract your original number.
 Divide by 6
 The number you are thinking of now is 3!
Last Edit: November 23, 2010, 01:50:53 AM by rivozzz Logged
Hero Member
Posts: 3114

Reply #1 on: December 17, 2010, 09:34:54 PM

Hey, that's a great start.   I recall that math trick!


Pages: [1] Go Up
Jump to:

Login with username, password and session length

Powered by MySQL Powered by PHP Powered by SMF 1.1.11 | SMF © 2006-2009, Simple Machines LLC Valid XHTML 1.0! Valid CSS!
Entire forum contents (c) 2009 classroomM.com. All rights reserved.