ID:186017
 
/*
MADLIB.C Source
Written by Jeremy Anderson
Only 1 word per prompt or your second word will be the next entry.
*/


#include <stdio.h>

void main()
{
char one[20];
char two[20];
char three[20];
char four[20];
char five[20];
char six[20];
char seven[20];
char eight[20];

printf("MADLIB version 1.0\n");
printf("Only 1 word per prompt or your second word will be the next entry\n\n");
printf("Enter a house hold item\n> ");
scanf("%s",&one);
printf("\nEnter the name of a country\n> ");
scanf("%s",&two);
printf("\nEnter a name\n> ");
scanf("%s",&three);
printf("\nEnter a funny job\n> ");
scanf("%s",&four);
printf("\nEnter a object that can we used as a weapon\n> ");
scanf("%s",&five);
printf("\nEnter a pet name\n> ");
scanf("%s",&six);
printf("\nEnter a body part name\n> ");
scanf("%s",&seven);
printf("\nEnter your most recently bought video game\n> ");
scanf("%s",&eight);
printf("Once apon a time, a brave %s set out on a quest across %s. \nBy his side was his good friend %s.\nTogether they slew the evil %s with a large %s, \nand recovered their lost pet %s. Following this, they sold \ntheir %s's for money, bought %s, and played the night away.\nThe End.",one,two,three,four,five,six,seven,eight);
printf("\n\nsay goodbye to leave!");
scanf("%s",&one);

}


Tommorow im going to learn If Else Goto so I can program a small text adventure, woot!

EDIT: The last part is formated weird due to me not wanting to make your windows scroll 3 pages sideways.
Tommorow im going to learn If Else Goto so I can program a small text adventure, woot!

Stay away from goto as you shouldn't need it :P.
Woah. Looks alot like DM (probably because its based of it, right? or is that a varient of C for DM?). I can understand most of that and I've never really looked closely at C in all my life.
Jermman wrote:
EDIT: The last part is formated weird due to me not wanting to make your windows scroll 3 pages sideways.

Don't worry, anyone using a Gekko-based browser will get a scroll bar on DM Code windows now. It's pretty sweet. If you're not using a Gekko-based browser, I recommend giving Mozilla's Firefox a try.
Oh man, that takes me back (20 years back, jeez I'm old!). My very first programs ever written on a computer (an IBM PC/XT with 4 MHz CPU, 256k memory, and a 10 MB hard drive) were Madlibs. Back around 4th or 5th grade my friends and I used to spend hours doing the dozen or so that I'd converted into BASIC programs. I seem to recall the most popular response for a noun was "private parts". Good times!

Man, even if I had that disk somewhere, I don't have anything that's capable of reading a 5 1/4" floppy. I'd love to look at that source code now.
In response to Mike H
Heh. I think I still have an old QBasic Mastermind clone around somewhere. I remember it because that was when I learnt how to use arrays. =)

My first program ever, though... absolutely no idea. =) I had dozens upon dozens of incomplete QBasic games - I'd spend an afternoon on each one then realise I didn't really have a clear idea of what I was doing and quit. Good times!
In response to Crispy
My first program was a command line calculator.

I posted about it here once. And I think I have it hosted on my blog too.
Takes me back to the good ol' days of programming for text MUDs. =)
Wow, just about all the languages seem the same. That sounds just like what I first learned in Java, as well.
In response to Theodis
Goto is actually taught in the book I am using.
In response to Jermman
USE WITH CARE!

http://en.wikipedia.org/wiki/Goto_(command)

I've never touched the goto command because of my great fear.

~Kujila
In response to Tiko
Tiko wrote:
Woah. Looks alot like DM (probably because its based of it, right? or is that a varient of C for DM?).

Copy+Pasted from the DM Guide, paragraph one of Appendix 1:

DM, like many modern programming languages, is an evolved form of C. Additional derivatives include C++, Java, Awk, and a host of others. Since these all share a common ancestor, they have many similarities in structure and syntax. A programmer familiar with one of them can adapt to the others with little difficulty.

Hiead
In response to Kujila
In one of my first programs, a couple of years ago, I used the goto command for the first time.

    verb/Set\ Name()
var/my_error = ""
Name
if(my_error != "")
alert(src,my_error)
var/aname = input("Enter a name for yourself:") as text
if(aname == "")
my_error = "You cannot have a blank name!"
goto Name
for(var/i=1,i<=length(aname),i++)
var/char = copytext(aname,i,i+1)
if(isnum(char))
my_error = "You cannot have numbers in your name!"
goto Name
name = aname
src << "Your name is now: [name]"


I know, some really stupid mistakes and overcomplexity of my code...that was one of the few programs I had saved to a CD-RW. Clearly, I should have done things like
        if(!aname)

instead of
        if(aname == "")

...and so on.

Hiead
In response to Jermman
Goto is actually taught in the book I am using.

It is poor form and you don't really need it :P. I haven't even used a goto command in over a decade in any language and the only reason then is because I simply didn't know better at the time.
In response to Hiead
An evolved form of C?Isn't evoloution succession or something within those bounds if DM were truly an evoloved form of C then Itd be faster and more capable.




(maybe Im saying this because I love C so much.)


For Jermanan(mispelled):
Its strange that Im a C programmer and Ive never made a madlib.... Its strange because the first binaryI ever made
drew a pixel that bounced around in the screen.
How was learning that madlib?




Itanium
In response to Itanium
An evolved form of C?Isn't evoloution succession or something within those bounds if DM were truly an evoloved form of C then Itd be faster and more capable.

If that is the case then everything devolved from Assembly.
In response to Itanium
I'd think that it is an evolved form because of it's superior easiness. DM may not be as powerful, but it's great for people who have never programmed, especially with such a good guide.
In response to Itanium
Itanium wrote:
An evolved form of C?Isn't evoloution succession or something within those bounds if DM were truly an evoloved form of C then Itd be faster and more capable.

Not necessarily. Evolution doesn't make things "better" - just more adapted to their environment. DM is more adapted to the "simplified game programming" environment than C is. Therefore, it could be considered an evolved version of C.