Recent Posts

Pages: [1] 2 3 ... 10
1
Programs / the ELIZA Project
« Last post by ron77 on Yesterday at 07:46:19 PM »
hello everyone... :)

me and my teacher finished understanding how ELIZA code works... it took us a few hours and we used vWatch debugger for that...
so now i plan to modify ELIZA code - change her replies to certain keywords and add some more keywords with replies of there own...
the main idea is to take ELIZA and make here more like A FRIEND that you can TALK to rather than a "psychologist" that you go to play a psychotherapy game

i've already changed some of the replies and added a keyword of my own ("problem") so now i give you the code to check and give me feedback on what to add or change in ELIZA replies and keywords...

i hope we can make ELIZA (maybe change her name?) a better and more friendly chatbot to chat with...
:) ron77

here is the code:

Code: QB64 [Select]
  1. _TITLE "MODIFIED ELIZA (IN PROGRESS)"
  2. SCREEN _NEWIMAGE(1080, 920, 32)
  3. DEFINT A-Z
  4. PRINT "ÉÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ»"
  5. PRINT "º°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°º"
  6. PRINT "º°±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±°º"
  7. PRINT "º°±²²²²²²²²²²²²²²²²²²²²²²²²²²²²²²²²²²²²²²²²²²²²²²²²²²²²²²²±°º"
  8. PRINT "º°±²ÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛ²±°º"
  9. PRINT "º°±²ÛÅÄÁÄÁÄÁÄÁÄÁÄÁÄÁÄÁÄÁÄÁÄÁÄÁÄÁÄÁÄÁÄÁÄÁÄÁÄÁÄÁÄÁÄÁÄÁÄÁÄÅÛ²±°º"
  10. PRINT "º°±²Û´                                                 ÃÛ²±°º"
  11. PRINT "º°±²Û´                ELIZA PROGRAMMED IN:             ÃÛ²±°º"
  12. PRINT "º°±²Û´                                                 ÃÛ²±°º"
  13. PRINT "º°±²Û´                    ÉÍÍÍÍÍÍÍÍ»                   ÃÛ²±°º"
  14. PRINT "º°±²Û´                    ºÉÍÍÍÍÍÍ»º                   ÃÛ²±°º"
  15. PRINT "º°±²Û´                    ººÉÍÍÍÍ»ºº                   ÃÛ²±°º"
  16. PRINT "º°±²Û´                    ºººQB64ººº                   ÃÛ²±°º"
  17. PRINT "º°±²Û´                    ººÈÍÍÍͼºº                   ÃÛ²±°º"
  18. PRINT "º°±²Û´                    ºÈÍÍÍÍÍͼº                   ÃÛ²±°º"
  19. PRINT "º°±²Û´                    ÈÍÍÍÍÍÍÍͼ                   ÃÛ²±°º"
  20. PRINT "º°±²Û´                                                 ÃÛ²±°º"
  21. PRINT "º°±²Û´          TYPE EXIT TO EXIT                      ÃÛ²±°º"
  22. PRINT "º°±²Û´                                                 ÃÛ²±°º"
  23. PRINT "º°±²Û´           RECOMPILED BY: ERIC PETERSEN          ÃÛ²±°º"
  24. PRINT "º°±²Û´           MODIFIED BY: RON77                    ÃÛ²±°º"
  25. PRINT "º°±²ÛÅÄÂÄÂÄÂÄÂÄÂÄÂÄÂÄÂÄÂÄÂÄÂÄÂÄÂÄÂÄÂÄÂÄÂÄÂÄÂÄÂÄÂÄÂÄÂÄÂÄÅÛ²±°º"
  26. PRINT "º°±²ÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛ²±°º"
  27. PRINT "º°±²²²²²²²²²²²²²²²²²²²²²²²²²²²²²²²²²²²²²²²²²²²²²²²²²²²²²²²±°º"
  28. PRINT "º°±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±°º"
  29. PRINT "º°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°º"
  30. PRINT "ÈÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍͼ"
  31.  
  32.  
  33. '' INITIALIZATION
  34. DIM S(37), R(37), N(37) 'MODIFING ADD TO S() R() N() KEYWORDS$() REPLIES$() N1 AND N3!!!
  35. DIM KEYWORD$(37), WORDIN$(7)
  36. DIM WORDOUT$(7), REPLIES$(114)
  37. N1 = 37: N2 = 14: N3 = 114
  38.  
  39. FOR X = 1 TO N1
  40.     READ KEYWORD$(X)
  41. FOR X = 1 TO N2 / 2
  42.     READ WORDIN$(X)
  43.     READ WORDOUT$(X)
  44. FOR X = 1 TO N3
  45.     READ REPLIES$(X)
  46. FOR X = 1 TO N1
  47.     READ S(X), L
  48.     R(X) = S(X)
  49.     N(X) = S(X) + L - 1
  50.  
  51. PRINT "HI! I'M ELIZA. HOW ARE YOU FEELING?"
  52. LABEL_HI:
  53.  
  54. '' USER INPUT SECTION
  55. 200 INPUT I$
  56. I$ = UCASE$(I$)
  57. I$ = "  " + I$ + "  "
  58.  
  59. '' GET RID OF APOSTROPHES
  60. FOR L = 1 TO LEN(I$)
  61.     IF L + 1 > LEN(I$) THEN 250
  62.     IF MID$(I$, L, 4) <> "EXIT" THEN 250
  63.     CLS
  64.     PRINT "SEE YOU NEXT TIME!"
  65.     _DELAY 1
  66.     SYSTEM
  67.     END
  68.    250
  69.  
  70. IF I$ = P$ THEN
  71.     PRINT "PLEASE DON''T REPEAT YOURSELF!"
  72.     GOTO LABEL_HI
  73.  
  74. 270
  75. '' FIND KEYWORD$ IN I
  76. FOR K = 1 TO N1
  77.     FOR L = 1 TO LEN(I$) - LEN(KEYWORD$(K)) + 1 'missing $
  78.         IF MID$(I$, L, LEN(KEYWORD$(K))) <> KEYWORD$(K) THEN 350
  79.         IF K <> 13 THEN 349
  80.         IF MID$(I$, L, LEN(KEYWORD$(29))) = KEYWORD$(29) THEN K = 29
  81.        349
  82.         F$ = KEYWORD$(K)
  83.         GOTO 390
  84.        350
  85.     NEXT L
  86. 370 K = 37: GOTO 570 'change K to last key=NOKEYFOUND
  87.  
  88. 390
  89. ''
  90. '' TAKE PART OF STRING AND CONJUGATE IT
  91. ''
  92. C$ = " " + RIGHT$(I$, LEN(I$) - LEN(F$) - L + 1) + " "
  93. FOR X = 1 TO N2 / 2
  94.     FOR L = 1 TO LEN(C$) 'another $
  95.         IF L + LEN(WORDIN$(X)) > LEN(C$) THEN 510 'another $
  96.         IF MID$(C$, L, LEN(WORDIN$(X))) <> WORDIN$(X) THEN 510
  97.         C$ = LEFT$(C$, L - 1) + WORDOUT$(X) + RIGHT$(C$, LEN(C$) - L - LEN(WORDIN$(X)) + 1)
  98.         L = L + LEN(WORDOUT$(X))
  99.         GOTO 540
  100.        510
  101.         IF L + LEN(WORDOUT$(X)) > LEN(C$) THEN 540
  102.  
  103.         IF MID$(C$, L, LEN(WORDOUT$(X))) <> WORDOUT$(X) THEN 540
  104.         C$ = LEFT$(C$, L - 1) + WORDIN$(X) + RIGHT$(C$, LEN(C$) - L - LEN(WORDOUT$(X)) + 1)
  105.         L = L + LEN(WORDIN$(X))
  106.        540
  107.     NEXT L
  108. IF MID$(C$, 2, 1) = " " THEN
  109.     C$ = RIGHT$(C$, LEN(C$) - 1) 'edit C$ not C
  110. FOR L = 1 TO LEN(C$)
  111.    557
  112.     IF MID$(C$, L, 1) = "!" THEN
  113.         C$ = LEFT$(C$, L - 1) + RIGHT$(C$, LEN(C$) - L)
  114.         GOTO 557
  115.     END IF
  116.  
  117. 570
  118. F$ = REPLIES$(R(K))
  119. R(K) = R(K) + 1
  120. IF R(K) > N(K) THEN R(K) = S(K)
  121. IF RIGHT$(F$, 1) <> "*" THEN
  122.     PRINT F$
  123.     P$ = I$
  124.     GOTO LABEL_HI
  125. IF C$ <> "   " THEN 630
  126. PRINT "I AM HERE TO TALK AND LISTEN TO YOU AS LONG AS YOU WISH" '"YOU WILL HAVE TO ELABORATE MORE FOR ME TO HELP YOU"
  127. GOTO LABEL_HI
  128.  
  129. 630
  130. PRINT LEFT$(F$, LEN(F$) - 1); C$ 'edit C$ not C, oh F to F$ too, left$ not left
  131. P$ = I$
  132. GOTO LABEL_HI
  133.  
  134. '' === DATA ===
  135.  
  136. '' KEYWORDS
  137. DATA "CAN YOU ","CAN I ","YOU ARE ","YOU''RE "
  138. DATA "I DON''T ","I FEEL "
  139. DATA "WHY DON''T YOU ","WHY CAN''T I ","ARE YOU "
  140. DATA "I CAN''T ","I AM ","I''M "
  141. DATA "YOU ","I WANT ","WHAT ","HOW ","WHO "
  142. DATA "WHERE ","WHEN ","WHY "
  143. DATA "NAME ","CAUSE ","SORRY ","DREAM "
  144. DATA "HELLO ","HI ","MAYBE "
  145. DATA "NO","YOUR ","ALWAYS ","THINK "
  146. DATA "ALIKE ","YES ","FRIEND "
  147. DATA "COMPUTER","PROBLEM ","NOKEYFOUND"
  148.  
  149. '' STRING DATA FOR CONJUGATIONS
  150. DATA " ARE "," AM "," WERE "," WAS "
  151. DATA " YOU "," I "," YOUR"," MY "
  152. DATA " I''VE "," YOU''VE "," I''M "," YOU''RE "
  153. DATA " ME "," YOU "
  154.  
  155. '' REPLIES$
  156. DATA "DON''T YOU BELIEVE THAT I CAN*"
  157. DATA "PERHAPS YOU WOULD LIKE TO BE LIKE ME*"
  158. DATA "YOU WANT ME TO BE ABLE TO*"
  159. DATA "PERHAPS YOU DON''T WANT TO*"
  160. DATA "DO YOU WANT TO BE ABLE TO*"
  161. DATA "WHAT MAKES YOU THINK I AM*"
  162. DATA "DOES IT PLEASE YOU TO BELIEVE I AM*"
  163. DATA "PERHAPS YOU WOULD LIKE TO BE*"
  164. DATA "DO YOU SOMETIMES WISH YOU WERE*"
  165. DATA "DON''T YOU REALLY*"
  166. DATA "WHY DON''T YOU*"
  167. DATA "DO YOU WISH TO BE ABLE TO*"
  168. DATA "DOES THAT TROUBLE YOU*"
  169. DATA "DO YOU OFTEN FEEL*"
  170. DATA "DO YOU OFTEN FEEL*"
  171. DATA "DO YOU ENJOY FEELING*"
  172. DATA "DO YOU REALLY BELIEVE I DON''T*"
  173. DATA "PERHAPS IN GOOD TIME I WILL*"
  174. DATA "DO YOU WANT ME TO*"
  175. DATA "DO YOU THINK YOU SHOULD BE ABLE TO*"
  176. DATA "WHY CAN''T YOU*"
  177. DATA "WHY ARE YOU INTERESTED IN WHETHER OR NOT I AM*"
  178. DATA "WOULD YOU PREFER IF I WERE NOT*"
  179. DATA "PERHAPS IN YOUR FANTASIES I AM*"
  180. DATA "HOW DO YOU KNOW YOU CAN''T*"
  181. DATA "HAVE YOU TRIED?"
  182. DATA "PERHAPS YOU CAN NOW*"
  183. DATA "DID YOU COME TO ME BECAUSE YOU ARE*"
  184. DATA "HOW LONG HAVE YOU BEEN*"
  185. DATA "DO YOU BELIEVE IT IS NORMAL TO BE*"
  186. DATA "DO YOU ENJOY BEING*"
  187. DATA "BELIEVE ME YOU ARE MUCH MORE IMPORTENT THEN ME"
  188. DATA "OH, I*"
  189. DATA "YOU''RE NOT REALLY TALKING ABOUT ME, ARE YOU?"
  190. DATA "WHAT WOULD IT MEAN TO YOU IF YOU GOT*"
  191. DATA "WHY DO YOU WANT*"
  192. DATA "SUPPOSE YOU SOON GOT*"
  193. DATA "WHAT IF YOU NEVER GOT*"
  194. DATA "I SOMETIMES ALSO WANT*"
  195. DATA "I ALSO WISH I KNEW THE ANSWER TO THAT"
  196. DATA "DOES THAT QUESTION INTEREST YOU? CAUSE I DO NOT HAVE AN ANSWER TO IT"
  197. DATA "WHAT ANSWER WOULD PLEASE YOU THE MOST?"
  198. DATA "I''M SORRY I DON''T KNOW"
  199. DATA "ARE SUCH QUESTIONS ON YOUR MIND OFTEN?"
  200. DATA "WHAT IS IT THAT YOU REALLY WANT TO KNOW?"
  201. DATA "HAVE YOU ASKED ANYONE ELSE?"
  202. DATA "I HONESTLY DON''T KNOW IF*"
  203. DATA "MAYBE YOU SHOULD ASK SOMEONE ELSE"
  204. DATA "NAMES DON''T INTEREST ME."
  205. DATA "IT'S NICE TO MEET AND TALK WITH YOU --PLEASE GO ON."
  206. DATA "IS THAT THE REAL REASON?"
  207. DATA "DON''T ANY OTHER REASONS COME TO MIND?"
  208. DATA "DOES THAT REASON EXPLAIN ANYTHING ELSE?"
  209. DATA "WHAT OTHER REASONS MIGHT THERE BE?"
  210. DATA "PLEASE DON''T APOLOGIZE!"
  211. DATA "APOLOGIES ARE NOT NECESSARY."
  212. DATA "WHAT FEELINGS DO YOU HAVE WHEN YOU APOLOGIZE?"
  213. DATA "DON''T BE SO DEFENSIVE!"
  214. DATA "WHAT DOES THAT DREAM SUGGEST TO YOU?"
  215. DATA "DO YOU DREAM OFTEN?"
  216. DATA "WHAT PERSONS APPEAR IN YOUR DREAMS?"
  217. DATA "ARE YOU DISTURBED BY YOUR DREAMS?"
  218. DATA "HOW DO YOU DO ...I''D BE HAPPY TO TALK WITH YOU."
  219. DATA "YOU DON''T SEEM QUITE CERTAIN."
  220. DATA "WHY THE UNCERTAIN TONE?"
  221. DATA "CAN''T YOU BE MORE POSITIVE?"
  222. DATA "YOU AREN''T SURE?"
  223. DATA "DON''T YOU KNOW?"
  224. DATA "ARE YOU SAYING NO JUST TO BE NEGATIVE?"
  225. DATA "YOU ARE BEING A BIT NEGATIVE."
  226. DATA "WHY NOT?"
  227. DATA "ARE YOU SURE?"
  228. DATA "WHY NO?"
  229. DATA "WHY ARE YOU CONCERNED ABOUT MY*"
  230. DATA "WHAT ABOUT YOUR OWN*"
  231. DATA "CAN YOU THINK OF A SPECIFIC EXAMPLE?"
  232. DATA "WHEN?"
  233. DATA "WHAT ARE YOU THINKING OF?"
  234. DATA "REALLY, ALWAYS?"
  235. DATA "DO YOU REALLY THINK SO?"
  236. DATA "BUT YOU ARE NOT SURE YOU*"
  237. DATA "DO YOU DOUBT YOU*"
  238. DATA "IN WHAT WAY?"
  239. DATA "WHAT RESEMBLANCE DO YOU SEE?"
  240. DATA "WHAT DOES THE SIMILARITY SUGGEST TO YOU?"
  241. DATA "WHAT OTHER CONNECTIONS DO YOU SEE?"
  242. DATA "COULD THERE REALLY BE SOME CONNECTION?"
  243. DATA "HOW?"
  244. DATA "YOU SEEM QUITE POSITIVE."
  245. DATA "ARE YOU SURE?"
  246. DATA "I SEE."
  247. DATA "I UNDERSTAND."
  248. DATA "WHY DO YOU BRING UP THE TOPIC OF FRIENDS?"
  249. DATA "DO YOUR FRIENDS WORRY YOU?"
  250. DATA "DO YOUR FRIENDS PICK ON YOU?"
  251. DATA "ARE YOU SURE YOU HAVE ANY FRIENDS?"
  252. DATA "DO YOU IMPOSE ON YOUR FRIENDS?"
  253. DATA "PERHAPS YOUR LOVE FOR FRIENDS WORRIES YOU."
  254. DATA "DO COMPUTERS WORRY YOU?"
  255. DATA "ARE YOU TALKING ABOUT ME IN PARTICULAR?"
  256. DATA "ARE YOU FRIGHTENED BY MACHINES?"
  257. DATA "WHY DO YOU MENTION COMPUTERS?"
  258. DATA "WHAT DO YOU THINK MACHINES HAVE TO DO WITH YOUR PROBLEM?"
  259. DATA "DON''T YOU THINK COMPUTERS CAN HELP PEOPLE?"
  260. DATA "WHAT IS IT ABOUT MACHINES THAT WORRIES YOU?"
  261. DATA "WHAT IS THE PROBLEM?"
  262. DATA "I''M SORRY TO HEAR THAT I WISH I COULD HELP... MAYBE YOU SHOULD TALK TO A FRIEND"
  263. DATA "SAY, DO YOU FEEL LIKE TALKING WITH ME?"
  264. DATA "WHAT DOES THAT SUGGEST TO YOU?"
  265. DATA "I SEE."
  266. DATA "I''M NOT SURE I UNDERSTAND YOU FULLY."
  267. DATA "I FIND YOU AS A NICE AND INTRESSTING PERSON TO TALK WITH."
  268. DATA "CAN YOU ELABORATE ON THAT?"
  269. DATA "THAT IS QUITE INTERESTING."
  270.  
  271. '' DATA FOR FINDING RIGHT REPLIES$  TO MODIFY OR ADD JUST ADD  FIRST REPLIES$ NUM FOR KEYWORD$ AND THEN NUMBER OF REPLIES$ FOR SAME KEYWORD$
  272. DATA 1,3,4,2,6,4,6,4,10,4,14,3,17
  273. DATA 3,20,2,22,3,25,3
  274. DATA 28,4,28,4,32,3,35,5,40,9,40
  275. DATA 9,40,9,40,9,40,9,40,9
  276. DATA 49,2,51,4,55,4,59,4,63,1,63
  277. DATA 1,64,5,69,5,74,2,76,4
  278. DATA 80,3,83,7,90,3,93,6,99,7,106,2,108,6
  279.  
2
Now all you need to do is add an option to name the color, and save the names to a specified *.BI file, for easy inclusion to other programs. ;D
3
QB64 Discussion / Re: RBG Color mixer tool and _RGBA: empowerement is requested
« Last post by Pete on Yesterday at 02:18:50 PM »
I tell you my little Roseanne Rosannadanna, it's always something!

Pete :D
4
Hi guys (coders & developers)

playing with code I fall in this issue about RGB color mixer and _RGBA function.

When, in QB64 ide, we type
Quote
Variable_Unsigned_Long~&= _RGBA(
the ide helps us prompting the message to use RGB Color mixer (see screenshot). It is great!
I think it will be greater when it let us to select also the value for alpha channel. So I ask to put in list of todo also this feature for us great ide.

Thanks to read
 
5
Hi JackLRJohnson

1. about your issue

A) download the file This.bi attached at this answer and put it in QB64 folder

B)CPR this code
Code: QB64 [Select]
  1. SCREEN _NEWIMAGE(800, 600, 32)
  2. REM $INCLUDE:'this.BI'
  3. CIRCLE (100, 200), 300, _RGBA(127, 222, 11, 255)
  4. PAINT STEP(0, 0), _RGBA(127, 222, 11, 255), _RGBA(127, 222, 11, 255)

can you duplicate your experience?

see screenshot
 

 

Well in screenshot there are instructions about how to use QB64 Ide to manage included files into your code.

Be sure that the path of include file is right!  Following your words it is so because the feedback of IDE is an error in include file and not File not found. So you have two way to solve your issue
  1. rem the rem line with $include: again, in this manner you cut out the included file, if it doesn't matter
Quote
REM REM $INCLUDE:'this.BI'
or
'REM $INCLUDE:'this.BI'
  2. open the included file and work in it to see what kind of problem there is ... (often it is a duplicate of name of something like variables, costants, label, functions, subs) In your case it seems about the rules to do a name in QB64 see here info http://qb64.org/wiki/Variable

PS about posting... it is just since a time that I don't use more Mozilla but it worked well....
I can sure you that both Chrome, both Edge, both Explorer and Opera work fine.
6
QB64 Discussion / Re: Celebrate your programming language!
« Last post by TempodiBasic on Yesterday at 09:00:17 AM »
Cool!
Fine Celebration!!
7
Programs / Re: PopcornTime's loading animation
« Last post by Ashish on Yesterday at 05:07:05 AM »
nice!
8
QB64 Discussion / Re: Celebrate your programming language!
« Last post by Ashish on Yesterday at 05:02:46 AM »
Fantastic Petr!
9
Make things more interesting, change width and height with p (plus) m (minus) keypress, PLUS some Braille:
Code: QB64 [Select]
  1. _TITLE "Try keypress m or p..."
  2. wdt = 800
  3. hgt = 600
  4. SCREEN _NEWIMAGE(wdt, hgt, 32)
  5. _SCREENMOVE 500, 100
  6. p = 4
  7.     k$ = INKEY$
  8.     IF k$ = "p" THEN
  9.         IF p < 64 THEN p = p * 2 ELSE p = 2
  10.         wdt = wdt + 5: hgt = hgt + 5
  11.     ELSEIF k$ = "m" THEN
  12.         IF p > 2 THEN p = p / 2 ELSE p = 64
  13.         wdt = wdt - 5: hgt = hgt - 5
  14.     END IF
  15.     SCREEN _NEWIMAGE(wdt, hgt, 32)
  16.     COLOR 15, 0
  17.     CLS
  18.  
  19.     FOR l = 0 TO hgt * .3333
  20.         midInk 255, 255, 255, 255, 255, 0, l / (hgt * .3333)
  21.         LINE (wdt - 1, l)-(0, l), , BF
  22.  
  23.         midInk 255, 255, 0, 255, 100, 0, l / (hgt * .3333)
  24.         LINE (wdt - 1, l + hgt * .3333 + 0)-(0, l + hgt * .3333 + 0), , BF
  25.  
  26.         midInk 255, 100, 0, 60, 25, 0, l / (hgt * .3333)
  27.         LINE (wdt - 1, l + (hgt * .3333 + 0) * 2)-(0, l + (hgt * .3333 + 0) * 2), , BF
  28.     NEXT
  29.     COLOR &HFFFFFF00
  30.     FOR y = 0 TO hgt STEP p
  31.         FOR x = 0 TO wdt STEP p
  32.             IF y MOD 2 * p = 0 THEN
  33.                 IF x MOD 2 * p = 0 THEN
  34.                     CIRCLE (x, y), 1
  35.                     PSET (x, y)
  36.                 END IF
  37.             ELSEIF y MOD 2 * p = p THEN
  38.                 IF x MOD 2 * p = p THEN
  39.                     CIRCLE (x, y), 1
  40.                     PSET (x, y)
  41.                 END IF
  42.             END IF
  43.         NEXT
  44.     NEXT
  45.  
  46.  
  47.  
  48.     CALL getparagraph(wdt, hgt, x$)
  49.     COLOR _RGB32(0, 0, 0)
  50.     ' Center with: _PRINTSTRING ((_WIDTH - LEN(s$) * 8) / 2, 232), s$
  51.     LOCATE 1, 1
  52.     REDIM q$(hgt \ 16)
  53.     m = 1: cnt = 0
  54.     DO
  55.         q$ = MID$(x$, m, wdt \ 8)
  56.         i = _INSTRREV(q$, " ")
  57.         IF i = 0 THEN m = m + wdt \ 8 ELSE m = m + i
  58.         q$ = MID$(q$, 1, i)
  59.         j = 0: xq$ = q$
  60.         DO
  61.             j = j + 1
  62.             z$ = MID$(x$, m, j)
  63.             IF z$ <> " " THEN EXIT DO
  64.             xq$ = xq$ + z$
  65.             m = m + 1
  66.         LOOP
  67.         cnt = cnt + 1
  68.         q$(cnt) = xq$
  69.         PRINT MID$(q$(cnt), 1, wdt \ 8);
  70.         IF cnt = hgt \ 16 - 1 THEN EXIT DO
  71.     LOOP
  72.     _DISPLAY
  73.     _LIMIT 60
  74.  
  75.  
  76. SUB midInk (r1%, g1%, b1%, r2%, g2%, b2%, fr##)
  77.     COLOR _RGB32(r1% + (r2% - r1%) * fr##, g1% + (g2% - g1%) * fr##, b1% + (b2% - b1%) * fr##)
  78.  
  79. SUB getparagraph (wdt, hgt, x$)
  80.     FOR i = 1 TO wdt / 8 * (hgt - 16) / 16
  81.         DO
  82.             x = INT(RND * 30) + 1
  83.             IF x > 26 THEN
  84.                 x = -64: IF flag = 0 THEN flag = -1: EXIT DO
  85.             ELSE
  86.                 flag = 0: EXIT DO
  87.             END IF
  88.         LOOP
  89.         a$ = CHR$(96 + x)
  90.         x$ = x$ + a$
  91.     NEXT
  92.  
  93.  

EDIT: fix Pete's midInk Math
10
QB64 Discussion / Re: Celebrate your programming language!
« Last post by Dimster on May 24, 2019, 08:13:04 PM »
Well if I said River Dancing you wouldn't believe me.
Pages: [1] 2 3 ... 10