Author Topic: Just a silly "Hello World" Marquis  (Read 10677 times)

0 Members and 1 Guest are viewing this topic.

Offline CharlieJV

  • Newbie
  • Posts: 89
    • View Profile
Just a silly "Hello World" Marquis
« on: April 05, 2022, 03:07:29 pm »
Just a barely tweaked Commodore BASIC program over on Rosetta Code, works in both BASIC Anywhere Machine and QB64.

I was in an old-school BASIC reminiscing mood ...


Offline bplus

  • Global Moderator
  • Forum Resident
  • Posts: 8053
  • b = b + ...
    • View Profile
Re: Just a silly "Hello World" Marquis
« Reply #1 on: April 05, 2022, 03:54:29 pm »
Classic Basic, like the frame!

Offline SierraKen

  • Forum Resident
  • Posts: 1454
    • View Profile
Re: Just a silly "Hello World" Marquis
« Reply #2 on: April 05, 2022, 06:46:33 pm »
That's cool Charlie!

I still remember my first "Hello World" in my High School Apple 2e BASIC class in the 1980's:

10 PRINT "HELLO WORLD"
20 GOTO 10

Muahahahahaha... well, we thought we were cool. :D

Offline bplus

  • Global Moderator
  • Forum Resident
  • Posts: 8053
  • b = b + ...
    • View Profile
Re: Just a silly "Hello World" Marquis
« Reply #3 on: April 05, 2022, 08:00:12 pm »
Code: QB64: [Select]
  1. 1 Print Mid$("Hello world!  ", i + 1) + Mid$("Hello world!  ", 1, i)
  2. i = (i + 1) Mod 14: _Limit 10: GoTo 1
  3.  

EDIT: think I have it fixed?
« Last Edit: April 05, 2022, 08:16:43 pm by bplus »

Offline SMcNeill

  • QB64 Developer
  • Forum Resident
  • Posts: 3972
    • View Profile
    • Steve’s QB64 Archive Forum
Re: Just a silly "Hello World" Marquis
« Reply #4 on: April 05, 2022, 09:33:16 pm »
Reminds me of the way we ended up doing "Hello World" back in high school where we tried our best to drive our teacher completely insane.

Imagine 30+ old Apple IIc computers running a program very similar to this one (no delays needed back then, of course!):

Code: QB64: [Select]
  1. Const Annoying_Sounds = -1 'TRUE!
  2.  
  3. centerText 10, "Hello World", 1
  4. centerText 12, "presented by", 1
  5. centerText 14, "Steve McNeill", 1
  6. centerText 16, "1990, Floyd VA", 1
  7.  
  8.  
  9. Sub centerText (y, text$, delay)
  10.     text$ = _Trim$(text$) 'strip off leading or trailing spaces
  11.     l = Len(text$) 'length of text
  12.     If l Mod 2 Then text$ = text$ + " " 'make it even sized length
  13.     h = l \ 2 + 1 'half length
  14.         w = _Width \ _FontWidth
  15.     Else
  16.         w = _Width
  17.     End If
  18.     xLimit = w / 2 - 1
  19.     For i = 0 To h - 1
  20.         x = 1
  21.         Do
  22.             Locate y, x: Print Mid$(text$, h - i - 1, 1);
  23.             Locate y, w - x - 1: Print Mid$(text$, h + i, 1);
  24.             If x > 1 Then
  25.                 Locate y, x - 1: Print " ";
  26.                 Locate y, w - x: Print " ";
  27.             End If
  28.             x = x + 1
  29.             If Annoying_Sounds Then Sound Rnd * 4000 + 39, delay
  30.             _Delay delay / 18
  31.         Loop Until x > xLimit
  32.         xLimit = xLimit - 1
  33.     Next
https://github.com/SteveMcNeill/Steve64 — A github collection of all things Steve!

Offline bplus

  • Global Moderator
  • Forum Resident
  • Posts: 8053
  • b = b + ...
    • View Profile
Re: Just a silly "Hello World" Marquis
« Reply #5 on: April 05, 2022, 09:57:10 pm »
Code: QB64: [Select]
  1. Width 130, 100: _FullScreen: View Print 1 To 100
  2. For i = 1 To 10: b$ = b$ + "Hello World! ": Next
  3. 1 Print Mid$(b$, i + 1) + Mid$(b$, 1, i)
  4. i = (i + 1) Mod 130: _Limit 10: GoTo 1
  5.  

No escape? nah, Alt+F4

Offline CharlieJV

  • Newbie
  • Posts: 89
    • View Profile
Re: Just a silly "Hello World" Marquis
« Reply #6 on: April 05, 2022, 10:02:32 pm »
I find all of this simple stuff fun and wondrous.  Takes me right back to the early 80's.

Offline SierraKen

  • Forum Resident
  • Posts: 1454
    • View Profile
Re: Just a silly "Hello World" Marquis
« Reply #7 on: April 06, 2022, 08:33:29 pm »
LOL Steve and B+!

My history of using BASIC is a bit scattered, but here you go:

1987 - Used my friend's Texas Instruments to program with using magazines.
1988 - My parents bought a Franklin 2000 (Apple 2e compatible - which Franklin was sued a bit later by Apple but I never knew about that) from Sears. Remember the HOME command instead of CLS?
1988 - I took 2 programming classes in school, one in High School (Apple 2e BASIC) and one in the summer in college (BASICA on IBM's) (while I was still in High School).
1992 - We sold the Franklin.
1995 - We bought a Pentium 90 with Windows 95 and that is when I met my first online buddies on the comp.lang.basic.misc newsgroup and made my own GeoCities website with my new QBasic programs.
1996 - I found a free small BASIC language with a compiler called ASIC 5.0. It was based a lot on GW-BASIC. I added a lot of these to the old All Basic Code monthly packets and put them on my website.
Then I got bored and didn't like trying to fix programs until midnight all the time so I stopped for awhile.
Around 2005 or so I tried Visual Basic a little bit but not much.
Then finally in 2019 I found QB64! :D

Offline _vince

  • Seasoned Forum Regular
  • Posts: 422
    • View Profile
Re: Just a silly "Hello World" Marquis
« Reply #8 on: April 06, 2022, 09:17:47 pm »
Code: QB64: [Select]
  1. _HelloWorld

Offline bplus

  • Global Moderator
  • Forum Resident
  • Posts: 8053
  • b = b + ...
    • View Profile
Re: Just a silly "Hello World" Marquis
« Reply #9 on: April 06, 2022, 09:26:44 pm »
Here is what the program looks like in my interpreter called oh:
 
image_2022-04-06_212637145.png

Offline SMcNeill

  • QB64 Developer
  • Forum Resident
  • Posts: 3972
    • View Profile
    • Steve’s QB64 Archive Forum
Re: Just a silly "Hello World" Marquis
« Reply #10 on: April 06, 2022, 09:37:22 pm »
Code: QB64: [Select]
  1. _HelloWorld

Your syntax is wrong.  PHEW!  For a moment there, I thought you'd found one of the hidden Easter Egg commands we've squirreled away in QB64!

You'll have to try a little better than that, I'm afraid.  😂🤣🤪
https://github.com/SteveMcNeill/Steve64 — A github collection of all things Steve!

Offline _vince

  • Seasoned Forum Regular
  • Posts: 422
    • View Profile
Re: Just a silly "Hello World" Marquis
« Reply #11 on: April 07, 2022, 03:45:07 am »
It's not an Easter Egg if they're ALL like that, Steve, squirreled away in the obscurity of uselessness

Offline Cobalt

  • QB64 Developer
  • Forum Resident
  • Posts: 878
  • At 60 I become highly radioactive!
    • View Profile
Re: Just a silly "Hello World" Marquis
« Reply #12 on: April 11, 2022, 11:52:53 am »
It's not an Easter Egg if they're ALL like that, Steve, squirreled away in the obscurity of uselessness

Should I be embarrassed that in my copy that command works?


 
HelloWorldCommand.jpg
Granted after becoming radioactive I only have a half-life!

Offline SMcNeill

  • QB64 Developer
  • Forum Resident
  • Posts: 3972
    • View Profile
    • Steve’s QB64 Archive Forum
Re: Just a silly "Hello World" Marquis
« Reply #13 on: April 11, 2022, 12:24:13 pm »
Should I be embarrassed that in my copy that command works?

Not at all!  My personal version of QB64 has a lot of little odd tweaks that the official version doesn't have.  It's nice to be able to mod your own.  ;)
https://github.com/SteveMcNeill/Steve64 — A github collection of all things Steve!