Guys I'm not committing necro on a thread for a stupid reason. I'm new and I don't want to create a new thread for something I've already found an existing thread for. I'm new to logic and working on one of my first assignments I'm not coming to be like "hey, do this for me. The idea is to create a madlib that uses five words. I wanted to randomize them and make sure none of them were the same as the previous. I think I have it down, I just want to see what people who know better than I would have to say about it. Thanks in advance.
WORD SELECTION- MADLIB
start
input myWord1
eof? No, proceed, yes, selfcheck.
input myword2
set myWord1 equals myWord2, discard, loop
myWord1 doesn't equal myWord2, use, loop
Stop
SELFCHECK
start
input mybasestory
input myfinalWord, all myWord1, my Word2.
set myfinalWord equals any myWord1 or myWord2, discard, loop,
myfinalWord does not equal any myWord1 or myWord2, proceed
set randomization
output mymadlib
stop
Re: Pseudocode Tutorial: The Basics
Started by rageoutfool, Sep 03 2010 12:32 PM
3 replies to this topic
#1
Posted 03 September 2010 - 12:32 PM
|
|
|
#2
Posted 03 September 2010 - 07:22 PM
un-necroed. It wasn't a good reason to revive a thread.
That said: what do you have so far?
That said: what do you have so far?
#3
Posted 04 September 2010 - 10:31 AM
WORD SELECTION- MADLIB
start
input myWord1
eof? No, proceed, yes, selfcheck.
input myword2
set myWord1 equals myWord2, discard, loop
myWord1 doesn't equal myWord2, use, loop
Stop
SELFCHECK
start
input mybasestory
input myfinalWord, all myWord1, my Word2.
set myfinalWord equals any myWord1 or myWord2, discard, loop,
myfinalWord does not equal any myWord1 or myWord2, proceed
set randomization
output mymadlib
stop
Thats what I have. The text book i'm using isn't very specific about wording or anything. It gave us a number doubling example which was
input myNumber
set myNumber *2
output myAnswer
So I tried to follow that, but it didn't explain how to word loops, randomization, discard of an unwanted outcome, or anything that I needed it to. (that's a textbook for you.) I apologize for necroing, though. I didn't want to start a new thread and then people say, "uh this already exists here...." And I didn't approach it stupidly, saying "here's my problem, make something for me."
Also, I e-mailed my professor and she hasn't gotten back to me yet, so I'll post my other questions. would I need the first stop (after the world selection) or no since it isn't really the end of the program, only that segment of it. (the end of the program is after the output of the self-check.) Also, the eof is after the first word input because I only need five words and don't want it to loop into the sixth. As I was writing it i mentally created the flowchart for it because I def think better visually than verbally. All input is def. welcome and if there is a better thread/section for this then please let me know. I have a feeling that I'm going to be checking my work and sharing things with you guys for a long time to come, so I don't want to start off on bad terms. (mainly the reason why i wrote the pseudocode before asking for help with it.)
Note: This is for Logic and Problem Solving, the basic prereq for the programming tract. So I don't need to write the code for the program or anything, just figure out the logic to it.
start
input myWord1
eof? No, proceed, yes, selfcheck.
input myword2
set myWord1 equals myWord2, discard, loop
myWord1 doesn't equal myWord2, use, loop
Stop
SELFCHECK
start
input mybasestory
input myfinalWord, all myWord1, my Word2.
set myfinalWord equals any myWord1 or myWord2, discard, loop,
myfinalWord does not equal any myWord1 or myWord2, proceed
set randomization
output mymadlib
stop
Thats what I have. The text book i'm using isn't very specific about wording or anything. It gave us a number doubling example which was
input myNumber
set myNumber *2
output myAnswer
So I tried to follow that, but it didn't explain how to word loops, randomization, discard of an unwanted outcome, or anything that I needed it to. (that's a textbook for you.) I apologize for necroing, though. I didn't want to start a new thread and then people say, "uh this already exists here...." And I didn't approach it stupidly, saying "here's my problem, make something for me."
Also, I e-mailed my professor and she hasn't gotten back to me yet, so I'll post my other questions. would I need the first stop (after the world selection) or no since it isn't really the end of the program, only that segment of it. (the end of the program is after the output of the self-check.) Also, the eof is after the first word input because I only need five words and don't want it to loop into the sixth. As I was writing it i mentally created the flowchart for it because I def think better visually than verbally. All input is def. welcome and if there is a better thread/section for this then please let me know. I have a feeling that I'm going to be checking my work and sharing things with you guys for a long time to come, so I don't want to start off on bad terms. (mainly the reason why i wrote the pseudocode before asking for help with it.)
Note: This is for Logic and Problem Solving, the basic prereq for the programming tract. So I don't need to write the code for the program or anything, just figure out the logic to it.
#4
Posted 04 September 2010 - 11:12 AM
That looks odd. I wouldn't accept that if I were teaching the class, but I don't really know what standards you're expected to be using, either.


Sign In
Create Account

Back to top









