Qbasicnews.com
February 27, 2020, 07:25:10 AM *
Welcome, Guest. Please login or register.

Login with username, password and session length
News: Back to Qbasicnews.com | QB Online Help | FAQ | Chat | All Basic Code | QB Knowledge Base
 
   Home   Help Search Login Register  
Pages: 1 [2] 3
  Print  
Author Topic: help w/another assignment...  (Read 7655 times)
LinkMaster Sab
Member
*
Posts: 82



« Reply #15 on: August 31, 2003, 09:08:55 PM »

Well, if you want to learn what he gave you, look up the help on MID$... it's simple really.
Logged

 LinkMaster Sab
whitetiger0990
__/--\__
*****
Posts: 2964



WWW
« Reply #16 on: August 31, 2003, 09:16:19 PM »

Quote from: "heavenraiza"
right. i could work w/what link gave me. i dont get what you gave me wt.

i'll explain it...

'contains the words duh
a$ = "HI   COOL GOOD BRAVONEAT "

let's break the confusing line up
PRINT 'obvios
RTRIM$ 'removes the spaces on the right of the word
MID$ () 'ok l;et move INSIDE the mid
a$ 'obvios it's the string to fet the txt from
(INT(RND * 4)) * 5 + 1 ' the starting postion
5 ' is the amount of characters to get

'lets break this up
INT() 'duh
(RND * 5) * 5 + 1 'takes a rnd number 0 - 4 times it by 5; 0, 5, 10, 15, 20; then adds one; 1, 6, 11, 16, 21


that good?
Logged


[size=10]Back by popular demand!
I will byte and nibble you bit by bit until nothing remains but crumbs.[/size]
Diroga
Been there, done that
*****
Posts: 1087


« Reply #17 on: August 31, 2003, 09:49:03 PM »

that was clever. but wont you get all the text on the left when it's 11, 16 ,21 ?
Logged
LinkMaster Sab
Member
*
Posts: 82



« Reply #18 on: August 31, 2003, 11:34:17 PM »

It may be clever, but my opinion is that it's overly complicated for the job needed to be done, and it limits the messages...
Logged

 LinkMaster Sab
Diroga
Been there, done that
*****
Posts: 1087


« Reply #19 on: August 31, 2003, 11:36:17 PM »

nice avatar. ff1 was good. i got stuck in the  dwarf village. took me awail to get teh dynomite.
Logged
LinkMaster Sab
Member
*
Posts: 82



« Reply #20 on: August 31, 2003, 11:37:59 PM »

Hehe... not only FF1, but 8-bit theater. http://nuklearpower.com... really funny stuff  :lol:
Logged

 LinkMaster Sab
Diroga
Been there, done that
*****
Posts: 1087


« Reply #21 on: August 31, 2003, 11:57:39 PM »

cool
Logged
whitetiger0990
__/--\__
*****
Posts: 2964



WWW
« Reply #22 on: September 01, 2003, 12:04:11 AM »

Quote from: "Diroga"
that was clever. but wont you get all the text on the left when it's 11, 16 ,21 ?

what do you mean. unless mistaken i believe to answer is no. run it and see

Quote from: "LinkMaster Sab"
It may be clever, but my opinion is that it's overly complicated for the job needed to be done, and it limits the messages...

limits messages?
Logged


[size=10]Back by popular demand!
I will byte and nibble you bit by bit until nothing remains but crumbs.[/size]
LinkMaster Sab
Member
*
Posts: 82



« Reply #23 on: September 01, 2003, 12:10:46 AM »

Sure. Say you want messages with more then 1 word, or even more then 5 letters... you'd have to change the whole code to do that, rather then just a simple PRINT command.
Logged

 LinkMaster Sab
whitetiger0990
__/--\__
*****
Posts: 2964



WWW
« Reply #24 on: September 01, 2003, 12:19:09 AM »

Quote from: "LinkMaster Sab"
Sure. Say you want messages with more then 1 word, or even more then 5 letters... you'd have to change the whole code to do that, rather then just a simple PRINT command.

no...
Code:
a$ = "I love cats I hate dogs Food is goodEat chicken "
RANDOMIZE TIMER
CLS
PRINT RTRIM$(MID$(a$, (INT(RND * 4)) * 12 + 1, 12))
Logged


[size=10]Back by popular demand!
I will byte and nibble you bit by bit until nothing remains but crumbs.[/size]
LinkMaster Sab
Member
*
Posts: 82



« Reply #25 on: September 01, 2003, 12:23:44 AM »

Bah, still have to change two things. Sorry, was thinking differently.
Logged

 LinkMaster Sab
whitetiger0990
__/--\__
*****
Posts: 2964



WWW
« Reply #26 on: September 01, 2003, 12:45:21 AM »

Quote from: "LinkMaster Sab"
Bah, still have to change two things. Sorry, was thinking differently.

hmm thinking differently...
Logged


[size=10]Back by popular demand!
I will byte and nibble you bit by bit until nothing remains but crumbs.[/size]
LinkMaster Sab
Member
*
Posts: 82



« Reply #27 on: September 01, 2003, 12:58:19 AM »

Thinking in terms of my C++ program... grabs words in a string of words and returns em. Handy.
Logged

 LinkMaster Sab
whitetiger0990
__/--\__
*****
Posts: 2964



WWW
« Reply #28 on: September 01, 2003, 01:00:01 AM »

Quote from: "LinkMaster Sab"
Thinking in terms of my C++ program... grabs words in a string of words and returns em. Handy.


Huh
what do you mean. how was it different?
Logged


[size=10]Back by popular demand!
I will byte and nibble you bit by bit until nothing remains but crumbs.[/size]
oracle
*/-\*
*****
Posts: 3652



WWW
« Reply #29 on: September 01, 2003, 02:48:07 AM »

Sorry to burst your high-and-almighty bubble whitetiger, but I already made the head/tail program using that method before you, look in the challenge section under that compo about shortest useful program Wink
Logged

Pages: 1 [2] 3
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.21 | SMF © 2015, Simple Machines Valid XHTML 1.0! Valid CSS!