Skip to content

Instantly share code, notes, and snippets.

@ayunav
Forked from mikekavouras/homework.m
Last active August 29, 2015 14:22
Show Gist options
  • Select an option

  • Save ayunav/95dad8e325ef7454da1c to your computer and use it in GitHub Desktop.

Select an option

Save ayunav/95dad8e325ef7454da1c to your computer and use it in GitHub Desktop.
//
// main.m
// Scan
//
// Created by Michael Kavouras on 6/9/15.
// Copyright (c) 2015 Mike Kavouras. All rights reserved.
//
#import <Foundation/Foundation.h>
int main(int argc, const char * argv[]) {
@autoreleasepool {
int leftOrRight;
printf("You wander deep into the woods. It's getting dark. You come across a fork in the road. What do you do? \n 0) left \n 1) right \n");
scanf("%d", &leftOrRight);
if (leftOrRight == 0) {
printf("You chose to go left. You're dead");
} else {
printf("You chose to go right. You live!");
}
}
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment