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

Pascal Procedure

Name: Anonymous 2012-11-20 17:41

Hey guys, learning pascal here. I'm new to this programming thing and i've got a problem that's been bugging me.

I've gotta write a procedure called print_words which receives a string as a parameter, and print all the words contained in the that string. Consider all the characters other than space as components of a word. So if i type:

This is a test 12$%ab

the program must return me:

This
is
a
test
12$%ab

Would anyone help me?

Name: Anonymous 2012-11-20 17:45

So far i could make it work outside a procedure, but i can't seem to put it inside.

Name: Anonymous 2012-11-20 17:45

test to see if i can add my code

Name: Anonymous 2012-11-20 17:46

Here's what I've got so far:



program words;
uses crt;
var
 phrase  :string;
 word:string;
 letter  :char;
 x      :integer;

begin
 clrscr;
 phrase:='';
 word:='';
 x:=1;                        
 repeat
  write('type a phrase: ');
  readln(phrase);
  until phrase<>'';
 while x<=length(phrase) do
 begin
  letter:=phrase[x];
  case letter of
   'a'..'z','A'..'Z':
    begin
     word:=word+letter;
     repeat
       x:=x+1;
       letter:=phrase[x];
       word:=word+letter;
      until (letter=' ') or (x=length(phrase));
     writeln(word);
     word:='';
    end;
  end;
  x:=x+1;
 end;
writeln;
readkey;
end.

Name: Anonymous 2012-11-20 17:57

Bumpity. I'm pretty desperate here.

Name: Anonymous 2012-11-20 18:02

This is CS101, go ask /g/.

Name: Anonymous 2012-11-20 18:04

You ``bumped'' after 11 minutes? Do you understand how this place works?

Name: Anonymous 2012-11-20 18:09

Been to /g/
Like i said, i'm pretty new to this and I've got the worst teacher money can buy. I'm broke as fuck, unemployed and I'm trying my best here to learn this thing.

If this is so easy for you could you kindly give me some help?

Name: Anonymous 2012-11-20 18:12

Your code works fine on my computer

Name: Anonymous 2012-11-20 18:15

>>8
Ask Stack Overflow, they usually deal with this kind of questions.

Name: Anonymous 2012-11-20 18:15

>>8
I'm unemployed, live in a third world country and pay my Internet/electricity bill by selling shitty enterprise applications I learned to program back when I lived with my family. Stop using shitty questions and read the damn tutorials on the Internet.

Name: Anonymous 2012-11-20 18:15

Yeah i know, i just gotta make it work within a procedure, and not in the body of the program.

That's the only problem.

Name: Anonymous 2012-11-20 18:15

>>11
*shitty excuses
I'm mad at these first world spoiled kids

Name: Anonymous 2012-11-20 18:19

>>13
Joke's on you, i live in Brazil.
Dude, I'm a 36 years old broke advertiser.
I lost my house, my partner in my agency died, my woman left me (because I'm broke as fuck). No lies, no excuses, I'm trying to learn something new to pull myself outta this situation.

Name: Anonymous 2012-11-20 18:24

>>10
Thanks, will try there!

Name: Anonymous 2012-11-20 18:35

>>14
My woman left me
Found the root of all your problems.

Your own fault for being a retard who brings problems willingly to his own life.

Fuck off, fagshit.

Name: Anonymous 2012-11-20 18:51

>>16
Cretin.

Name: FFP 2012-11-20 18:58

>>17
Tsk. Tsk.

maybe you should check your privilege.

Name: Anonymous 2012-11-20 18:59

OP you should visit IRC channels rather than this shit hole.

Name: Anonymous 2012-11-20 18:59

why pascal?

Name: Anonymous 2012-11-20 19:09

>>17
I'm going to curtail the nasty end of your civil shotgun, fagshit.

>>18
Go menstruate somewhere else, Shlomette.

Name: Anonymous 2012-11-20 19:11

I lold.

Name: Fuck off, ``faggot'' 2012-11-20 19:12

>>22
That was VIP quality!

Share on Twitter | Share on Facebook | Share on le Reddit

Name: Anonymous 2012-11-20 19:52

function print_words(str) {
  return str.split(' ').forEach(function(word) {
    console.log(word);
  });
}

Name: Anonymous 2012-11-20 20:06

>>24
It's possible to write this in one unindented line of FIOC.

Javashit truly is the shittiest language on the face of Earth.

Name: Anonymous 2012-11-20 20:52

>>23
funny that I don't have an account on any of those sites and you most likely do.

your post is not better than mine idiot.

Name: Anonymous 2012-11-20 20:57

and you most likely do
What's the base for your stupid claim?

Why are you bumping this thread with your shitty posts?

Name: Anonymous 2012-11-20 21:11

stats
reddit actually has great boards and can be helpful

and the fact that in certain industries such as game development online presence is necessary.
For networking and general career success.


I am simply have not needed those yet.

Name: Anonymous 2012-11-20 21:14

am >>28
forgot to quote you >>27

should be obvious though

Name: Anonymous 2012-11-20 21:15

>>28-29
Stop bumping the thread, /g/ shitstain.

Name: Anonymous 2012-11-20 21:16

>>30
make me

Name: Anonymous 2012-11-20 21:17

i don't want to sagge
problem?

Name: Anonymous 2012-11-20 21:19

op hab u tride symta?

Name: Anonymous 2012-11-20 21:24

>>32
le /b/roblem face

epin post /b/ro XD

Name: Anonymous 2012-11-20 21:24

what's the post count until a thread is pruned?

Name: Anonymous 2012-11-20 21:27

>>34
toasting in epic bread

Name: Anonymous 2012-11-20 21:29

>>35
Holy shit, go back to the imageboards.

Name: Anonymous 2012-11-20 21:31

>>37
don't feel like it.
what  have i done wrong my friend?
show me rules i have broken and i will consider it.

Name: Anonymous 2012-11-20 21:32

>>38
You broke the rule of not being a faggot.

Name: Anonymous 2012-11-20 21:33

also >>37 is pig disgusting.

can't ignore poster , he doesn't even write script to prune thread or think to flag/ post.

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