October 12, 2024, 05:05:36 pm
Welcome,
Guest
. Please
login
or
register
.
Did you miss your
activation email?
1 Hour
1 Day
Forever
Login with username, password and session length
News
: Want to see a specific Tutorial? ASK!
Home
Help
Search
Arcade
Links
Staff List
Login
Register
New Text Challenge
Weekly Qbasic and Qb64 Lesson Topics
>
Forum
>
TUTORIALS
>
Text Adventure
>
New Text Challenge
Pages: [
1
]
« previous
next »
Print
Author
Topic: New Text Challenge (Read 1879 times)
ChatKing
Post Demos
Posts: 23
New Text Challenge
«
on:
October 13, 2012, 03:38:10 pm »
Hi Friends
Can anybody write qbasic code for the following challenge.
A program where we enter a complete sentence and then program display each word singly on a separate lines.
Let me explain
Console ask for the a complete sentence, let suppose use input. We are humans
and the program display it like this
We
are
humans
I am waiting for the replies and your code. When I get your code, then I will share with you mine code.
Thanks
Report Spam
Logged
GarrisonRicketson
Admin
Administrator
Hero Member
Posts: 583
Re: New Text Challenge
«
Reply #1
on:
October 24, 2012, 12:10:55 pm »
I had something like this, somewhere , Sorry to be slow on the reply. If I can remember, or find the code I had for this, I'll post it
from Garry
Report Spam
Logged
From Garry
http://www.garryricketsonartworks.com/SMF
http://www.garryricketsonartworks.com/phpbbforum
http://www.garryricketsonartworks.org
http://www.garryspages.webs.com
http://wittywittywhatisthat.freesmfhosting.com/index.php
http://www.garryricketsonartworks.com/FluxBB
SMcNeill
Newbie
Posts: 3
Re: New Text Challenge
«
Reply #2
on:
November 24, 2012, 12:17:45 am »
An easy solution to this one:
Code:
DIM sentence AS STRING, word AS STRING
PRINT "Give me a sentence: ";
INPUT sentence
sentence = sentence + " "
DO
wordpos = INSTR(sentence, " ")
word = LEFT$(sentence, wordpos - 1)
sentence = RIGHT$(sentence, LEN(sentence) - wordpos)
PRINT word
LOOP UNTIL wordpos = 0
«
Last Edit: November 24, 2012, 12:20:07 am by SMcNeill
»
Report Spam
Logged
GarrisonRicketson
Admin
Administrator
Hero Member
Posts: 583
Re: New Text Challenge
«
Reply #3
on:
November 24, 2012, 08:20:50 am »
Thanks
SMcNeill
I tried it and it works good. Thanks for stopping by and posting this.
from Garry
Report Spam
Logged
From Garry
http://www.garryricketsonartworks.com/SMF
http://www.garryricketsonartworks.com/phpbbforum
http://www.garryricketsonartworks.org
http://www.garryspages.webs.com
http://wittywittywhatisthat.freesmfhosting.com/index.php
http://www.garryricketsonartworks.com/FluxBB
Pages: [
1
]
Print
« previous
next »
Jump to:
Please select a destination:
-----------------------------
General Category
-----------------------------
=> Useful Information ,Rules,FAQs,LINKS,etc.
===> INTRODUCE Yourself
=> General QB64 Forum
=> MS DOS, FREE DOS, ANY DOS
-----------------------------
QB64 lessons and tutorials,Games
-----------------------------
=> Lesson Disussion
=> Weekly Lesson
=> Games
-----------------------------
TUTORIALS
-----------------------------
=> QB64 Tutorials
=> Text Adventure
=> QBasic Tutorials
=> Other Tutorials
-----------------------------
UNSEENS GDK+SFML Librarys
-----------------------------
=> Discussions on GDK+SFML
=> GDK+SFML Demos, and projects
-----------------------------
DEMOS
-----------------------------
=> Working QB64 Demos
=> QB64 Games
=> QB64 Programs You Are Proud Of.
=> Function + SUB Club
-----------------------------
OFF TOPIC,and Off The wall
-----------------------------
=> OffTopic and Off the Wall
Powered by
EzPortal
Loading...