Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - SquirrelMonkey

Pages: [1] 2
1
Programs / Re: Wordle clone
« on: March 07, 2022, 05:36:11 pm »
Your code made my game way faster. Thanks, Dav!
https://archive.org/details/weirdle_20220306

2
Programs / Re: Rotating Pyramid
« on: March 05, 2022, 05:18:52 pm »
Another quickie for this morning and Aurels Forum: http://basic4all.info8-hosting.info/index.php

Showing Aurel how he might do this more satisfactory with his MicroA interpreter with this QB64 example:
Code: QB64: [Select]
  1. _Title "Rotating Pyramid" 'b+ 2022-03-01
  2. cx = _Width / 2
  3. ax = cx: ay = 50 ' apex
  4. ex = cx: ey = 330 ' ellipse
  5. xr = cx * .7: yr = .33 * xr
  6.     Cls
  7.     x1 = ex + xr * Cos(a): y1 = ey + yr * Sin(a)
  8.     x2 = ex + xr * Cos(a + _Pi * .5): y2 = ey + yr * Sin(a + _Pi * .5)
  9.     x3 = ex + xr * Cos(a + _Pi): y3 = ey + yr * Sin(a + _Pi)
  10.     x4 = ex + xr * Cos(a + _Pi * 1.5): y4 = ey + yr * Sin(a + _Pi * 1.5)
  11.     l x1, y1, x2, y2
  12.     l x2, y2, x3, y3
  13.     l x3, y3, x4, y4
  14.     l x4, y4, x1, y1
  15.     l x1, y1, ax, ay
  16.     l x2, y2, ax, ay
  17.     l x3, y3, ax, ay
  18.     l x4, y4, ax, ay
  19.     a = a + .01
  20.     _Display
  21.     _Limit 30
  22.  
  23. Sub l (a, b, c, d) ' this is just way easier to code lines Aurel you dont need this part
  24.     Line (a, b)-(c, d)
  25.  

 
QB64 Rotate Pyramid.PNG


Love this, reminds me of the demo scene.

3
Programs / Re: Wordle clone
« on: March 05, 2022, 05:13:48 pm »
That IS Weird Paul! Love him so much. Nice work m8.

Yes, the one and only. :D

4
Programs / Re: Wordle clone
« on: March 05, 2022, 05:13:22 pm »
Sounds interesting.

I don't think LINE INPUT accepts a given input limit, but I made a restricted input routine function that you can freely have/use/abuse.

- Dav

Code: QB64: [Select]
  1. '==========
  2. 'KINPUT.BAS
  3. '==========
  4. 'Restricted keyboard INPUT$ routine.
  5. 'Limit how many characters you can enter.
  6. 'Coded by Dav, JAN/2021
  7.  
  8. a$ = KINPUT$(3, 3, "Enter up to 12 letters: ", 12)
  9.  
  10. PRINT "You entered: "; a$
  11.  
  12.  
  13. FUNCTION KINPUT$ (y, x, text$, limitnum)
  14.  
  15.     LOCATE y, x: PRINT text$;
  16.  
  17.     entry$ = ""
  18.     y = CSRLIN: x = POS(1)
  19.  
  20.     DO
  21.         a$ = INPUT$(1)
  22.  
  23.         IF a$ = CHR$(13) THEN 'enter returns entry
  24.             KINPUT$ = entry$: EXIT FUNCTION
  25.         END IF
  26.  
  27.         IF a$ = CHR$(27) THEN 'ESC bails out
  28.             KINPUT$ = "": EXIT FUNCTION
  29.         END IF
  30.  
  31.         IF a$ = CHR$(8) THEN 'Backspace goes back a space
  32.             IF LEN(entry$) > 0 THEN
  33.                 entry$ = MID$(entry$, 1, LEN(entry$) - 1)
  34.             END IF
  35.         ELSE
  36.             'add letter entered, if not over limitnum
  37.             IF LEN(entry$) < limitnum THEN
  38.                 entry$ = entry$ + a$
  39.             END IF
  40.         END IF
  41.  
  42.         LOCATE y, x: PRINT SPACE$(limitnum);
  43.         LOCATE y, x: PRINT entry$;
  44.  
  45.     LOOP
  46.  
  47.  

Thank you! Going to try this code.

5
Programs / Wordle clone
« on: March 05, 2022, 12:49:24 pm »
I am working on Weirdle, a Weird Paul themed Wordle clone in QuickBASIC.
The part of the program where you have to enter words is very slow. I wish I could use LINE INPUT, but with a limited amount of characters. Is that possible?

weirdle_005.png
   

Embedded in the browser: https://archive.org/details/weirdle_20220305_0655

Files: https://github.com/joluijten/Weirdle

6
Programs / Re: LCD Clock With Speech And Bouncing Ball
« on: January 28, 2022, 03:01:47 pm »
Looks great!

7
Programs / Re: QR experiment
« on: January 28, 2022, 02:58:45 pm »
Found this.

8
Programs / QR experiment
« on: January 28, 2022, 02:53:39 pm »
I made a fake QR-code generator, but I want to convert it into a working text to QR-code generator. For this I need to know how QR codes work.

This is all the information I can find:
- A QR code contains position indicators, format information converted into monochrome blocks, data converted into monochrome blocks.
- A higher version of a QR code means a bigger size.
-  There are 4 "error correction levels" (L, M, Q, and H). L has the lowest error correction capability but can contain more data.
- It is also possible to set a mode, like numeric or alphanumeric. The alphanumeric mode indicator (probably for URLs and text) is "0010".
- The QR code also contains a character count indicator. If the QR code is "hello", 5 characters need to be indicated in binary (000000101).
- The version information is stored near two position indicators.
- The format information is also stored near position indicators.

Where can I find more information about where and how to put information in a QR-code?

Code: QB64: [Select]
  1. Line (11, 11)-(46, 46), 15, BF: Line (10, 10)-(47, 47), 1, B ' white square with blue border
  2. Line (12, 12)-(19, 19), 0, B: Line (14, 14)-(17, 17), 0, BF ' square 1
  3. y = 26: Line (12 + y, 12)-(19 + y, 19), 0, B: Line (14 + y, 14)-(17 + y, 17), 0, BF ' square 2
  4. x = 26: Line (12, 12 + x)-(19, 19 + x), 0, B: Line (14, 14 + x)-(17, 17 + x), 0, BF ' square 3
  5.  
  6. ' Here some random fake data
  7. For e = 1 To 9
  8.     For a = 0 To 15
  9.         If Int(Rnd * 2) = 1 Then Circle (21 + a, 11 + e), 0, 0 Else Circle (21 + a, 11 + e), 0, 15
  10.     Next a
  11. For e = 1 To 16
  12.     For a = 0 To 33
  13.         If Int(Rnd * 2) = 1 Then Circle (12 + a, 20 + e), 0, 0 Else Circle (12 + a, 20 + e), 0, 15
  14.     Next a
  15. For e = 1 To 13
  16.     For a = 0 To 24
  17.         If Int(Rnd * 2) = 1 Then Circle (21 + a, 32 + e), 0, 0 Else Circle (21 + a, 32 + e), 0, 15
  18.     Next a
  19.  
  20.  

9
Programs / Simple digital clock
« on: January 25, 2022, 09:31:56 pm »
Code: QB64: [Select]
  1. _Title "Clock"
  2. Locate 25, 1: Print String$(79, 220);: Locate 2, 1: Print String$(79, 223);
  3. Locate 21, 2: Print String$(77, 176);: Locate 22, 2: Print String$(77, 177);
  4. Locate 23, 2: Print String$(77, 178);: Locate 24, 2: Print String$(77, 219);
  5. For a = 1 To 24
  6.     Locate a + 1, 1: Print Chr$(219);
  7.     Locate a + 1, 79: Print Chr$(219);
  8. Next a: Palette 0, 1: Palette 1, 15
  9. Do: Locate 1, 1: Print " "; Time$
  10.     For b = 0 To 7: For a = 1 To 73: r$ = InKey$: If r$ <> "" Then End
  11.         If Point(a, b) = 0 Then Locate b + 9, a + 1: Print Chr$(32); Else Print Chr$(Int((Rnd * 3) + 176));
  12.         Next a
  13.         teller = teller + 1
  14.         If teller > 77 Then Locate 21, 2: Print String$(77, 176);
  15.         If teller > 77 Then Locate 22, 2: Print String$(77, 177);
  16.         If teller > 77 Then Locate 23, 2: Print String$(77, 178);
  17.         If teller > 77 Then Locate 24, 2: Print String$(77, 219);
  18.         If teller > 77 Then teller = 1
  19.         Locate 21, teller + 1: Print Chr$(219);: Locate 22, teller + 1: Print Chr$(178);
  20.         Locate 23, teller + 1: Print Chr$(177);: Locate 24, teller + 1: Print Chr$(176);
  21.     Next b: _Delay 1: Sound 29948, 0.03
  22.  
  23.  
  24.  

10
Programs / Re: Text-to-speech in QB64
« on: December 29, 2021, 02:02:26 pm »
Yeah not trying to take away from your fun, sorry if I gave that impression.
Just showing a Quick easy to use tool for QB64 on Windows.

No problem, I even learned something from your code. Didn't know that you could use Dim that way.
There is even a command prompt way to do Speech-to-Text.

11
Programs / Re: Text-to-speech in QB64
« on: December 29, 2021, 12:01:36 pm »
Code: QB64: [Select]
  1.     Shell _Hide "Powershell -Command " + Chr$(34) + "Add-Type -AssemblyName System.Speech; (New-Object System.Speech.Synthesis.SpeechSynthesizer).Speak('" + message + "');" + Chr$(34)
  2.  

If text-to-speech were integrated in QB64, I would have agreed with you. Using external software with "shell" takes away the fun of experimenting, imo. Also, it's only 444kb. The ZIP file contains the video as well.

12
Programs / Re: Text-to-speech in QB64
« on: December 29, 2021, 11:50:35 am »

13
Programs / Re: Text-to-speech in QB64
« on: December 28, 2021, 11:36:35 pm »
Some additional info that could be useful: https://www.thoughtco.com/sounds-in-english-language-3111166

14
Programs / Text-to-speech in QB64
« on: December 28, 2021, 11:35:42 pm »
Hi!

Thanks to the help of hardcore programmers on Discord, I made my first text-to-speech program.
The first lines the program says are, "Hello, this is a test. I would like to thank you."

It is still very primitive.

It reads a phonetic input from a text file and converts it into speech.

The English language contains 19 vowel sounds (5 short vowels, 6 long vowels, 3 diphthongs, 2 oo sounds, and 3 r-controlled vowel sounds) and 25 consonant sounds.

I attempted to make a simple speech generator with these main ingredients. I recorded the sounds.
Of course, language is more complex. There are a lot of phonological processes going on (assimilation, elision, etc.) and there is also intonation, stress, volume and many other processes.

But hey, this is a beginning. I know that there are geniuses on this forum who create chess programs and even moon orbit programs.

My recordings are not great. English is my 3rd language. When it comes to phonetics my English is 2 on the scale of Arnold Schwarzenegger. When it comes to phonology, I know how to improve the program. When it comes to programming not, unfortunately. So feel free to adapt this, improve this, etc.

An example video:


15
Programs / Re: Test card
« on: December 24, 2020, 11:57:32 pm »
verry cool!
Also the music!

Thanks! The music is from the Youtube Audio Library and it's free.

Pages: [1] 2