Author Topic: to remember an old funny challange on 15 lines of code...  (Read 4093 times)

0 Members and 1 Guest are viewing this topic.

Offline TempodiBasic

  • Forum Resident
  • Posts: 1792
    • View Profile
to remember an old funny challange on 15 lines of code...
« on: November 09, 2019, 05:05:51 pm »
on an old my notebook I find this my code to run the challenge...
Code: QB64: [Select]
  1. 1 SCREEN _NEWIMAGE(600, 600, 32)
  2. 2 FOR a = 1 TO 10 STEP 1
  3.    3 IF (a * b) MOD 50 = 0 THEN _FONT 16 ELSE PLAY "mbmnt200o3l8 a4efg4fed4dfa4gfe4efL4gafddmsT200o2l8 f4c+de4dc+afadfdedc+ac+degfeL4dad"
  4.    4 FOR b = 1 TO 50 STEP 1
  5.        5 LINE (INT(RND * 300) + a, INT(RND * 200) + b)-(INT(RND * 400) + a, INT(RND * 400) + b), _RGB(INT(RND * 255), INT(RND * 255), INT(RND * 255)), BF
  6.        6 CIRCLE STEP(0, 0), b * 10, _RGB(INT(RND * 255), INT(RND * 255), INT(RND * 255))
  7.        7 _DELAY .1
  8. 8 NEXT b, a
  9. 9 my_ha = _COPYIMAGE(_SCREENIMAGE(1, 1, _DESKTOPWIDTH, _DESKTOPHEIGHT), 33) 'take a screenshot and use it as our texture
  10. 10 FOR a = 1 TO (_HEIGHT + 1) STEP _HEIGHT / 30
  11.    11 _PRINTSTRING (100, 100), "QB64 is reinessance of QB"
  12.    12 _PUTIMAGE (1, a), my_ha, 0
  13.    13 _DISPLAY
  14.    14 _DELAY .1
  15. 15 NEXT a
  16.  

and this other posted after that above...
Code: QB64: [Select]
  1. 1 SCREEN _NEWIMAGE(600, 400, 32)
  2. 2 _FONT 16
  3. 3 DO
  4.    4 FOR B = 1 TO 600 STEP 16
  5.        5 FOR a = 1 TO 400 STEP 16
  6.            6 IF Colors <= 0 THEN Colors = 255 ELSE Colors = Colors - 16
  7.            7 IF INKEY$ = "" THEN Green = Colors ELSE Green = 0
  8.            8 IF _KEYDOWN(13) THEN Blu = Colors ELSE Blu = 0
  9.            9 IF _KEYDOWN(100304) THEN Red = Colors ELSE Red = 0
  10.            10 COLOR _RGB32(Red, Green, Blu)
  11.            11 _PRINTSTRING (B, a), CHR$(INT(RND * 25) + 65)
  12.    12 NEXT a, B
  13.    13 _PRINTSTRING (1, 1), "HOLD LEFT SHIFT AND/OR ENTER TO SEE MORE...ESCAPE OR SPACE TO QUIT!"
  14.    14 _LIMIT 20
  15.  

This year has there  been a challenge that I have loosen?
Programming isn't difficult, only it's  consuming time and coffee

Offline bplus

  • Global Moderator
  • Forum Resident
  • Posts: 8053
  • b = b + ...
    • View Profile
Re: to remember an old funny challange on 15 lines of code...
« Reply #1 on: November 09, 2019, 09:48:53 pm »
Here is fresh off the press High Card Game that keeps running score in 10 lines, no double parking with colons!

Code: QB64: [Select]
  1. d$ = "111122223333444455556666777788889999JJJJQQQQKKKKAAAA"
  2. 1 c = 2 * INT(RND * 52 + 1) - 1
  3. p = 2 * INT(RND * 52 + 1) - 1
  4. IF c > p THEN PRINT SPACE$(24); "Computer's "; MID$(d$, c, 2); " beats Player's "; MID$(d$, p, 2)
  5. IF p > c THEN PRINT SPACE$(24); "Player's "; MID$(d$, p, 2); " beats Computer's "; MID$(d$, c, 2)
  6. IF c > p THEN computer&& = computer&& + 1
  7. IF c < p THEN player&& = player&& + 1
  8. _TITLE SPACE$(52) + "Tiny High Card Game    Computer:" + STR$(computer&&) + "   Player:" + STR$(player&&)
  9.  
  10. '' assuming suit order as Ascending Alphabit: lowest to highest Clubs, Diamonds, Hearts, Spades as in Bridge
  11.  
  12. 'use this code to rebuild d$ above because forum can't handle ASCII
  13. 'FOR v = 1 TO 13
  14. '    FOR s = 1 TO 4
  15. '        ' sorry 10 doesn't work well here so cards are 1 to 9 J Q K A
  16. '        d$ = d$ + MID$("123456789JQKA", v, 1) + MID$(CHR$(5) + CHR$(4) + CHR$(3) + CHR$(6), s, 1)
  17. '    NEXT
  18. 'NEXT
  19. '_CLIPBOARD$ = d$
  20.  
  21.  
« Last Edit: November 09, 2019, 09:56:45 pm by bplus »

Offline AndyA

  • Newbie
  • Posts: 73
    • View Profile
Re: to remember an old funny challange on 15 lines of code...
« Reply #2 on: November 10, 2019, 01:22:02 pm »
Here's something I found at the German BlitzBasic forum.

Code: QB64: [Select]
  1. _TITLE "3D Sinusoidal Plot by Hectic"
  2. SCREEN _NEWIMAGE(720, 720, 32)
  3.     _LIMIT 25
  4.     za# = za# + 1
  5.     FOR qq# = 0 TO 4999
  6.         x1# = SIN(_D2R(qq# / 2)) / 4
  7.         y1# = COS(_D2R(qq# / 1.5)) / 8
  8.         x2# = SIN(_D2R(qq# * x1# + za#)) * (qq# + x1#) / 15
  9.         y2# = COS(_D2R(qq# * y1#)) * (qq# + y1#) / 15
  10.         LINE (x2# + 360, y2# + 360)-(x2# + 363, y2# + 363), _RGB(ABS(SIN(_D2R(qq# / 20))) * 255, 0, ABS(COS(_D2R(qq# / 20))) * 255), BF
  11.     NEXT
  12.     _DISPLAY
  13.     CLS
  14. 'SYSTEM

Offline bplus

  • Global Moderator
  • Forum Resident
  • Posts: 8053
  • b = b + ...
    • View Profile
Re: to remember an old funny challange on 15 lines of code...
« Reply #3 on: November 10, 2019, 01:56:43 pm »
Oh that's nice!

Offline TempodiBasic

  • Forum Resident
  • Posts: 1792
    • View Profile
Re: to remember an old funny challange on 15 lines of code...
« Reply #4 on: November 11, 2019, 10:01:38 am »
Fine Bplus !
Cool 3D AndyA!

I can learn from your code that Math is too important to code!
Programming isn't difficult, only it's  consuming time and coffee