Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Do It Yourself Project Ideas
#8
(03-26-2025, 11:20 AM)bplus Wrote: Since the mention of jokes for meditation I pulled up my Henny pecked application from 2018.


Just a collection of one-liners saved in a Jokes.txt file:
sample of mine:
Quote:A computer once beat me at chess, but it was no match for me at kick boxing.
What did one ocean say to the other ocean? Nothing, they just waved.
A bank is a place that will lend you money, if you can prove that you do not need it.
What is faster, hot or cold? Hot, because you can catch a cold.
Whats the difference between a new husband and a new dog? After a year, the dog is still excited to see you.
Love may be blind, but marriage is a real eye-opener.
I say no to sweets, they dont listen.

read the txt file into a string array.
add some code to display one-liners in center of screen.
I could make mine with a little bigger text that we've been playing with here recently.
Code: (Select All)
Sub Text (x, y, textHeight, fore As _Unsigned Long, back As _Unsigned Long, txt$)
    Dim fg As _Unsigned Long, bg As _Unsigned Long, cur&, i&
    fg = _DefaultColor: bg = _BackgroundColor: cur& = _Dest
    i& = _NewImage(8 * Len(txt$), 16, 32)
    _Dest i&: Color fore, back: _PrintString (0, 0), txt$
    _PutImage (x, y)-Step(Len(txt$) * textHeight / 2, textHeight), i&, cur&
    Color fg, bg: _FreeImage i&: _Dest cur&
End Sub
Or just load your favorite font Smile

and I added a voice to read the joke, nothing beats the monotone of computer voice for Steven Wright jokes Big Grin

code I use in Windows for voice read jokes:
Code: (Select All)
Sub speak (message As String)
    Shell _Hide "Powershell -Command " + Chr$(34) + "Add-Type -AssemblyName System.Speech; (New-Object System.Speech.Synthesis.SpeechSynthesizer).Speak('" + message + "');" + Chr$(34)
End Sub

There you have it, another Do-It-Yourself Project!

Great; Respiration: a real inspiration (but may bring on excessive perspiration)!
I love that text-to-voice sub - may add that to some of my games to read Instructions etc. if that's ok ?
Of all the places on Earth, and all the planets in the Universe, I'd rather live here (Perth, W.A.) Big Grin
Please visit my Website at: http://oldendayskids.blogspot.com/
Reply


Messages In This Thread
Do It Yourself Project Ideas - by bplus - 03-24-2025, 04:03 PM
RE: Do It Yourself Project Ideas - by Pete - 03-24-2025, 06:48 PM
RE: Do It Yourself Project Ideas - by bplus - 03-24-2025, 07:17 PM
RE: Do It Yourself Project Ideas - by Pete - 03-24-2025, 07:22 PM
RE: Do It Yourself Project Ideas - by bplus - 03-24-2025, 07:24 PM
RE: Do It Yourself Project Ideas - by bplus - 03-26-2025, 10:50 AM
RE: Do It Yourself Project Ideas - by bplus - 03-26-2025, 11:20 AM
RE: Do It Yourself Project Ideas - by PhilOfPerth - 03-27-2025, 04:04 AM
RE: Do It Yourself Project Ideas - by bplus - 03-27-2025, 02:09 PM
RE: Do It Yourself Project Ideas - by SMcNeill - 03-27-2025, 03:27 PM
RE: Do It Yourself Project Ideas - by bplus - 03-27-2025, 04:16 PM
RE: Do It Yourself Project Ideas - by PhilOfPerth - 03-28-2025, 02:27 AM
RE: Do It Yourself Project Ideas - by madscijr - 03-28-2025, 04:31 AM
RE: Do It Yourself Project Ideas - by SMcNeill - 03-28-2025, 11:12 AM
RE: Do It Yourself Project Ideas - by bplus - 03-28-2025, 10:14 AM
RE: Do It Yourself Project Ideas - by madscijr - 03-28-2025, 10:32 PM
RE: Do It Yourself Project Ideas - by madscijr - 03-28-2025, 11:47 AM
RE: Do It Yourself Project Ideas - by Pete - 03-28-2025, 07:16 PM
RE: Do It Yourself Project Ideas - by madscijr - 03-28-2025, 11:32 PM



Users browsing this thread: 1 Guest(s)