Welcome, Guest
You have to register before you can post on our site.

Username/Email:
  

Password
  





Search Forums

(Advanced Search)

Forum Statistics
» Members: 318
» Latest member: coletteleger
» Forum threads: 1,745
» Forum posts: 17,906

Full Statistics

Latest Threads
astuce pour survivre fina...
Forum: Utilities
Last Post: coletteleger
05-14-2025, 04:47 AM
» Replies: 0
» Views: 9
trouver permis de conduir...
Forum: Utilities
Last Post: nicolasrene
05-05-2025, 05:24 AM
» Replies: 0
» Views: 14
LIGHTBAR Menu
Forum: Programs
Last Post: nicolasrene
05-05-2025, 05:08 AM
» Replies: 15
» Views: 945
Learning Pallet Rack Safe...
Forum: Utilities
Last Post: Sandrapew
04-03-2025, 09:36 AM
» Replies: 0
» Views: 39
Choosing New Versus or Pr...
Forum: Utilities
Last Post: Sandrapew
03-18-2025, 01:11 AM
» Replies: 0
» Views: 33
The QB64 IDE shell
Forum: Utilities
Last Post: JasonPag
09-16-2024, 05:37 PM
» Replies: 9
» Views: 1,059
Importance regarding Ches...
Forum: Utilities
Last Post: JasonPag
09-01-2024, 06:34 PM
» Replies: 0
» Views: 71
Chess and Analysis and En...
Forum: Utilities
Last Post: JasonPag
08-28-2024, 02:37 PM
» Replies: 0
» Views: 68
DAY 009:_PutImage
Forum: Keyword of the Day!
Last Post: grymmjack
09-02-2023, 02:57 PM
» Replies: 54
» Views: 3,439
Fall Banner Contest?
Forum: Site Suggestions
Last Post: grymmjack
08-31-2023, 11:50 PM
» Replies: 36
» Views: 2,169

 
  Tip: How to get your pathed program name
Posted by: bplus - 04-22-2022, 01:49 PM - Forum: Utilities - Replies (7)

Code: (Select All)
PathedProgram$ = Command$(0) 'or process commands sent
Print PathedProgram$

Print this item

  Possibility of Members Only access section
Posted by: Richard - 04-22-2022, 12:34 PM - Forum: General Discussion - No Replies

Wondering if it is possible to have a new section (QB64 related material) where QB64 community members only have access?

This might discourage attempts to download our material into questionable sites.

Print this item

  Linux difficulties compared to Windows
Posted by: bplus - 04-22-2022, 12:29 PM - Forum: Help Me! - Replies (3)

I, bplus, am newbie to Linux the Mint Cinnamon Distro which is a subset of Ubuntu but with more Windows like appearance if I read my book right.

Anyway I am testing the Battleship app Johnno and I put together, everything is fine until I am halfway through a game with all effects going (mostly just sound files playing) and the thing just ups and quits, no messages, nothing?! When I play without effects it's fine and I can run a whole game to win or lose. I think there were some wav files and possibly those are Windows preferred? But why would they work for awhile and then not? 

Another goofy thing: I am testing a graphics program, a mod of Kens's spiral flower and it just automatically says compiler error see log... I check and it's blank, over and over? I'm thinking there is some invisible character that doesn't show in IDE because I commented out the whole program and still get compiler error message. Weird!

And another thing:
I am testing old Spinners program, that takes a screenshot of desktop and then displays that with spiders crawling all over... oh wait the Wiki did say taking screen shots does not work in Linux, never mind.

Windows has no problem with this, IDE in Linux is happy but the compiler gives me error even when I comment more and more until all of the code:

Code: (Select All)
_Title "b+ Makeover #2 of Ken's Rotating Flower"
Dim image As Long
Screen _NewImage(700, 700, 32)
_ScreenMove 250, 20
For r = 0 To 60 Step .25
    Circle (350, 350), r, _RGB32(255 - r * 4, 0, 0), , , .5 'ovals half width for height
Next
image = _CopyImage(0)
Print " Here is one petal, press any to continue..."
Sleep
For i = 0 To 700
    Line (0, i)-(700, i), _RGB32(0, 160, 255 - i / 700 * 255)
Next
For r = 20 To 0 Step -.25 ' draw a yellow center
    Circle (350, 350), r, &HFFFFFF00
Next
r = 250: zoom = 1
Do ' each loop draws a ring of petals around the center starting on outside
    For a = start To _Pi(2) - .00001 Step _Pi(2 / 30) ' a goes around a circle from 0 to 2*pi = 360 degrees
        x = 350 + r * Cos(a): y = 350 + r * Sin(a) ' here is x, y coordinate for petal center
        angle = _Atan2(350 - y, 350 - x) ' here is the angle of the petal to the center of screen
        RotoZoom x, y, image, zoom, _R2D(angle) ' draw petal centered at x, y, scaled at zoom level, convert angle radians to degrees for rotozoom
        _Display
        _Delay .1
    Next
    zoom = zoom * .75 ' decrease petal scale by 75%
    r = r * .75 '  'next ring of petals decrease radius by 75%
    If r < 20 Then Exit Do ' r is too small we are done!
    toggle = 1 - toggle ' this alters petals so they are offset each time around
    If toggle Then start = -_Pi(1 / 30) Else start = 0 ' offset by half the angle "a" step size
Loop Until InKey$ = Chr$(27)
Sleep

Sub RotoZoom (X As Long, Y As Long, image&, Scale As Single, Rotation As Single)
    Dim px(3) As Single: Dim py(3) As Single
    W& = _Width(image&): H& = _Height(image&)
    px(0) = -W& / 2: py(0) = -H& / 2: px(1) = -W& / 2: py(1) = H& / 2
    px(2) = W& / 2: py(2) = H& / 2: px(3) = W& / 2: py(3) = -H& / 2
    sinr! = Sin(-Rotation / 57.2957795131): cosr! = Cos(-Rotation / 57.2957795131)
    For i& = 0 To 3
        x2& = (px(i&) * cosr! + sinr! * py(i&)) * Scale + X: y2& = (py(i&) * cosr! - px(i&) * sinr!) * Scale + Y
        px(i&) = x2&: py(i&) = y2&
    Next
    _MapTriangle (0, 0)-(0, H& - 1)-(W& - 1, H& - 1), image& To(px(0), py(0))-(px(1), py(1))-(px(2), py(2))
    _MapTriangle (0, 0)-(W& - 1, 0)-(W& - 1, H& - 1), image& To(px(0), py(0))-(px(3), py(3))-(px(2), py(2))
End Sub

Print this item

  Code and stuff forum - needs sub forum
Posted by: jakebullet70 - 04-22-2022, 12:19 PM - Forum: General Discussion - Replies (4)

Need to add a Snippets sub forum. I got snippets!!!  Wink

Print this item

  Fully Featured Sudoku App
Posted by: bplus - 04-22-2022, 11:45 AM - Forum: bplus - Replies (7)

I will be adding to this little corner of forum my QB64 code as I check them in through Linux QB64 v 1.5 (I don't need debug), they already work fine in Windows v2.0 

Sudoku is by far my most used and favorite app I've created with QB64 and version 2020-08-08 has been tested allot! 

The Sudoku app has 2 screens, the first is just an Info/Help screen from which you enter a level of play.
 
Levels are mostly determined by the number of clues you are given, the more the easier.
The lower levels are for practice or flash card like automatic skills builder. 6 gives intermediate puzzle 7 a little harder intermediate 8 would be hardest but takes longer to build for unique solution and may end up a level 7 puzzle.
9 gives you a blank puzzle and puts you in Make Mode and you can click in a puzzle from newspaper or book.
Remember to click back to Puzzle Mode when done making the puzzle.

The Puzzle screen has some menu buttons:
The first on left toggles the solution, ON OFF
The 2nd from left toggles the check cell mode. ON will not allow you to make a simple error of putting a 2nd number in row, column or 3x3 cell block and beep you if you try. Just because you are not beeped, doesn't mean it is correct.
The Load and Save buttons work with one Temp file. Just rename that file or copy and rename if you want to store a special puzzle, perhaps one that was particularly hard. Otherwise every time you save a puzzle the last one in Temp will be overwritten.

Play: Is basically clicking a number from number palette and left click a cell to answer or right click to toggle a note of that number on and off again. To remove a number clicked in, set the number palette to 0, click that in and then reset to number you want to do next.
[Image: Sudoku-Info-Levels.png]

[Image: Sudoku-Puzzle-sheet.png]


.zip   Sudoku 2020-08-08.zip (Size: 539.28 KB / Downloads: 93)


Oh! This is putting the zip file at the top of the post! No wonder I couldn't find it!

Print this item

  ASCII Picker
Posted by: SMcNeill - 04-22-2022, 03:11 AM - Forum: SMcNeill - No Replies

You guys may have seen something like this somewhere before, but this is the original, prettier version than the one that exists inside the QB64 IDE.  Big Grin

Code: (Select All)
_Title "External ASCII Picker"
Screen _NewImage(640, 480, 32)
f = _LoadFont("cour.ttf", 128) 'a nice large display font, not a 100% match to QB64's inbuilt version,
_Font f '                      but it works easily here for a demo highlight character



_ControlChr Off
Do
    out$ = ASCIIbox$ 'get an ASCII character
    If out$ = "" Then System
    Print out$, Asc(out$) 'preview it
    Sleep: _KeyClear 'hit a key to select another
    Cls
Loop

Function ASCIIbox$
    Static temp As Long, temp1 As Long, ws As Long
    d = _Dest
    font = _Font
    If temp = 0 Then 'static backgrounds so we don't have to make them over and over, or worry about freeing them
        temp = _NewImage(640, 480, 32)
        temp1 = _NewImage(640, 480, 32)
        ws = _NewImage(640, 480, 32)
    End If
    Screen temp
    Dim CurrentASC(1 To 16, 1 To 16)
    Dim CurrentOne As Integer
    Cls , _RGB(0, 0, 170)
    Color , _RGB(0, 0, 170)
    For y = 1 To 16
        For x = 1 To 16
            Line (x * 40, 0)-(x * 40, 480), _RGB32(255, 255, 0)
            Line (0, y * 30)-(640, y * 30), _RGB32(255, 255, 0)
            If counter Then _PrintString (x * 40 - 28, y * 30 - 23), Chr$(counter)
            counter = counter + 1
        Next
    Next

    _Dest temp1
    Cls , _RGB(0, 0, 170)
    Color , _RGB(0, 0, 170)
    counter = 0
    For y = 1 To 16
        For x = 1 To 16
            Line (x * 40, 0)-(x * 40, 480), _RGB32(255, 255, 0)
            Line (0, y * 30)-(640, y * 30), _RGB32(255, 255, 0)
            text$ = LTrim$(Str$(counter))
            If counter Then _PrintString (x * 40 - 24 - (Len(text$)) * 4, y * 30 - 23), text$
            counter = counter + 1
        Next
    Next
    _Dest temp

    x = 1: y = 1
    _PutImage , temp, ws
    Do: Loop While _MouseInput 'clear the mouse input buffer
    oldmousex = _MouseX: oldmousey = _MouseY

    Do
        _Limit 60
        Do: Loop While _MouseInput
        If oldx <> _MouseX And oldy <> _MouseY Then
            x = _MouseX \ 40 + 1 'If mouse moved, where are we now?
            y = _MouseY \ 30 + 1
        End If
        oldx = _MouseX: oldy = _MouseY

        num = (y - 1) * 16 + x - 1
        If num = 0 Then
            text$ = ""
        Else
            flashcounter = flashcounter + 1
            If flashcounter > 30 Then
                Color _RGB32(255, 255, 255), _RGB(0, 0, 170)
                text$ = Chr$(num)
                If Len(text$) = 1 Then text$ = " " + text$ + " "
            Else
                Color _RGB32(255, 255, 255), _RGB(0, 0, 170)
                text$ = RTrim$(LTrim$(Str$(num)))
            End If
        End If
        If flashcounter = 60 Then flashcounter = 1
        Cls
        If toggle Then _PutImage , temp1, temp Else _PutImage , ws, temp
        _PrintString (x * 40 - 24 - (Len(text$)) * 4, y * 30 - 23), text$
        Line (x * 40 - 40, y * 30 - 30)-(x * 40, y * 30), _RGBA32(255, 255, 255, 150), BF

        k1 = _KeyHit
        MouseClick = 0: MouseExit = 0
        If MouseButtonSwapped Then
            MouseClick = _MouseButton(2): MouseExit = _MouseButton(1)
        Else
            MouseClick = _MouseButton(1): MouseExit = _MouseButton(2)
        End If
        Select Case k1
            Case 13: Exit Do
            Case 27
                GoTo cleanexit
            Case 32: toggle = Not toggle
            Case 18432: y = y - 1
            Case 19200: x = x - 1
            Case 20480: y = y + 1
            Case 19712: x = x + 1
        End Select

        If x < 1 Then x = 1
        If x > 16 Then x = 16
        If y < 1 Then y = 1
        If y > 16 Then y = 16
        _Display
        If MouseExit GoTo cleanexit
    Loop Until MouseClick

    ret% = (y - 1) * 16 + x - 1
    If ret% > 0 And ret% < 255 Then
        ASCIIbox$ = Chr$(ret%)
    End If
    cleanexit:
    _AutoDisplay

    Screen d
    _Font font
    _Dest 0: _Delay .2

End Function

Print this item

  Announcements
Posted by: Pete - 04-22-2022, 02:39 AM - Forum: TheBOB - No Replies

This thread is reserved for any upcoming announcements.

Print this item

  New General Discussion Subforums
Posted by: admin - 04-22-2022, 02:05 AM - Forum: General Discussion - Replies (13)

If you're signed in as a member of the forums here, you'll see that we have two new subforums there: NSFW (18+) and Freedom to Speak.

Both of these are completely off-topic and password protected forums.  In fact, they're hidden forums to boot, that only registered members can decide if they want to participate in them, or not.  One thing people always objected about with "off topic" discussions in the past was that "they don't look professional for a site" and blah, blah, blah...

To address those concerns, the forums are hidden from the general public by nature.  Folks have to go through the trouble to sign up and become a member of our boards to even know they exist.

Safeguard #2, these forums are each password protected.  If you're going out of your way to join a forum, read up and ask folks about a password to a subforum, and then decide to be offended at the contents of those forums after having to jump through such hoops...   /sigh   I guess I'll just be happy to offend you, as it's obvious you went out of your way in an attempt to get in that state.  

So what are these two forums??  And what features do they offer that others don't?  Why would any sane person bother with jumping through the hoops to get into them?

Both forums are dedicated to the idea of us being built around a community, and for folks to have a freedom to speak with each other.  One thing I always hated about the old forums, before they disappeared, was the Off-Topic forum being taken away.  There should be some place where people who share the same hobby -- in this case QB64 -- can come together and get to know and talk to each other as people and not just as programmers.  Why shouldn't the users be able to talk about politics, or sports, or religion, or their favorite TV shows?  As members of the same community, they already have at least one trait in common -- they like the BASIC language -- so why shouldn't they be allowed to talk and chat and explore if they share other interests as well??

I dunno!!  In my opinion, they should!

And thus, we have the two dreaded sub-forums that people either tend to love, or else they tend to hate.



NSFW (18+) is for people to talk about adult stuff.  As long as what you post in here isn't illegal, I don't care what you post.  Pictures of your infected toe nail turning green and falling off?  I don't care!  Want to trade nudes with Pete?  I don't care!  (/BLARF!!)  Want to talk about some NC-17 movie?  An erotica book you read?  I don't care!  And neither should anyone else who deliberately decides to force themselves inside a password protected forum.

If 18+ stuff isn't your cup of tea, simply don't go into that forum.  If people post something you object to -- and it's not illegal (like kiddy porn, for example) -- then just ignore it and move on to the next topic.  I'd say that we don't have any members who would post anything *THAT* bad in there, but then somebody would have to go and prove me wrong just for the shits of it.   

Dodgy



Freedom to Speak is a more friendly version of the NSFW channel.  Talk politics.  Religion.  Get into heated arguments with each other over whether C is better than COBOL...  Just try and keep the imagery and such suitable enough that the conversation doesn't end up getting moved into the 18+ forum.



Both forums are going to be VERY lightly moderated, with people free to post and say what they want in them.  Unless things get to the point that they're illegal (discussions about how to build a bomb and blow up the president, with step by step illustrated bomb making guides, for an example...), then I'm not going to step in and moderate people's freedom to speech.  Chat with each other.  Talk about each other's hobbies.  Get peeved and fight with each other.  That's what a community does -- particularly one that exercises its freedom of speech with each other.

And, if you've gotten this far in reading, and think you might be interested in joining in such talks, then let me ask you two last questions:

What do you have to be to view any sort of adult material?  "over 18"

What limits do we place upon free speech and the freedom to speak?  "none"

Print this item

  Fractal Explorer
Posted by: vince - 04-22-2022, 01:42 AM - Forum: Programs - Replies (3)

left click to zoom in
right click to zoom out
mouse wheel to change zoom window
'+' or '-' key to increase or decrease iterations

Code: (Select All)
defint a-z

const sw = 800
const sh = 600

dim shared pi as double
pi = 4*atn(1)

dim shared mx,my,mbl,mbr,mw

dim u as double, v as double
dim uu as double, vv as double
dim xx as double, yy as double
dim x0 as double, y0 as double
dim z as double, zz as double
dim c as single
z = 0.004
zz = 0.1
x0 = -0.5

dim p1 as long
p1 = _newimage(sw, sh, 32)
screen _newimage(sw, sh, 32)

redraw = -1
iter = 100

do
        mw = 0
        getmouse

        if redraw then
                for y = 0 to sh-1
                for x = 0 to sw-1
                        u = 0
                        v = 0

                        xx = (x - sw/2)*z + x0
                        yy = (y - sh/2)*z + y0

                        for i = 0 to iter
                                '''mandelbrot
                                uu = u*u - v*v + xx
                                vv = 2*u*v + yy
                                '''

                                '''burning ship
                                'u = abs(u)
                                'v = abs(v)
                                'uu = u*u - v*v + xx
                                'vv = 2*u*v + yy
                                '''

                                '''tricorn
                                'u = u
                                'v = -v
                                'uu = u*u - v*v + xx
                                'vv = 2*u*v + yy
                                '''

                                '''tetration
                                'u = u
                                'v = v
                                'cexp uu, vv, u, v, u, v
                                'cexp uu, vv, uu, vv, xx, yy
                                '''

                                u = uu
                                v = vv

                                if (u*u + v*v) > 4 then exit for
                        next
                        if i > iter then
                                pset(x, y), _rgb(0,0,0)
                        else
                                c = i/iter
                                r =  80 - 80*sin(2*pi*c - pi/2)
                                g = (114 + 114*sin(2*pi*c*1.5 - pi/2)) * -(c < 0.66)
                                b = (114 + 114*sin(2*pi*c*1.5 + pi/2)) * -(c > 0.33)

                                pset(x, y), _rgb(r, g, b)
                        end if
                next
                next

                'locate 1,1
                'print "iter =";iter
                _title str$(iter)

                _dest p1
                _putimage , 0
                _dest 0

                _putimage , p1
                _autodisplay

                redraw = 0
        end if

        if mw < 0 then
                zz = zz + 0.01
        elseif mw > 0 then
                if zz > 0.01 then zz = zz - 0.01
        end if

        'draw box
        if omx <> mx or omy <> my or mw <> 0 then
                _putimage , p1
                line (mx - (sw*zz/2), my - (sh*zz/2))-step(sw*zz,sh*zz),_rgb(255,255,255),b
                _autodisplay

                omx = mx
                omy = my
        end if

        if mbl then
                do
                        getmouse
                loop while mbl

                x0 = x0 + (mx - sw/2)*z
                y0 = y0 - (sh/2 - my)*z
                z = z*zz

                iter = iter + 100

                redraw = -1
        elseif mbr then
                do
                        getMouse
                loop while mbr

                x0 = x0 + (mx - sw/2)*z
                y0 = y0 - (sh/2 - my)*z
                z = z/zz

                iter = iter - 100

                redraw = -1
        end if

        k = _keyhit
        if k = 43 then
                iter = iter + 50
                redraw = -1
        elseif k = 45 then
                if iter > 50 then iter = iter - 50
                redraw = -1
        end if

loop until k = 27
system

sub getmouse ()
        do
                mx = _mousex
                my = _mousey
                mbl = _mousebutton(1)
                mbr = _mousebutton(2)
                mw = mw + _mousewheel
        loop while _mouseinput
end sub

Print this item

  USA Flag
Posted by: vince - 04-21-2022, 10:35 PM - Forum: Programs - Replies (7)

Waving and shaded 3D US flag.  Drawn according to official specification

Code: (Select All)
deflng a-z

sw = 640
sh = 480

dim shared pi as double
pi = 4*atn(1)

screen _newimage(sw*2, sh, 32)

h = 300
w = 1.9*h
a = h/7

img = _newimage(w, h, 32)
_dest img
x0 = 0
y0 = 0

line (0, 0)-step(w, h),_rgb(255,255,255),bf
for i=0 to 6
        line (0, i*h*2/13)-step(w, h/13),_rgb(255*0.698,255*0.132,255*0.203),bf
next
line (0, 0)-step(w*2/5, h*7/13),_rgb(255*0.234,255*0.233,255*0.430),bf

for i=0 to 4
for j=0 to 5
        starf (j*2 + 1)*w*2/(5*12), (i*2 + 1)*h*7/130, h*4/(13*5*2), _rgb(255,255,255)
next
next

for i=1 to 4
for j=1 to 5
        starf (j*2)*w*2/(5*12), (i*2)*h*7/130, h*4/(13*5*2), _rgb(255,255,255)
next
next

_dest 0
_putimage (sw/2 - w/2, sh/2 - h/2), img
_source img

x0 = sw/2 - w/2 + sw
y0 = sh/2 - h/2 '+ sh

dim t as double
dim z as double

dim xx as double, yy as double
dim dx as double, dy as double
do
        t = t + 0.2

        line (sw,0)-step(sw, sh),_rgb(0,0,0),bf

        for y=0 to h + a*0.707 step 1
        for x=0 to w + a*0.707 step 1
                z = (0.1 + 0.4*(x/w))*a*sin(x/35 - y/70 - t) + 0.5*a
                dz = 50*a*cos(x/35 - y/70 - t)/35

                xx = x + z*0.707 - a*0.707
                yy = y - z*0.707

                if (int(xx) >=0 and int(xx) < w - 1 and int(yy) >= 0 and int(yy) < h - 1) then
                        tl = point(int(xx), int(yy))
                        tr = point(int(xx) + 1, int(yy))
                        bl = point(int(xx), int(yy) + 1)
                        br = point(int(xx) + 1, int(yy) + 1)

                        dx = xx - int(xx)
                        dy = yy - int(yy)

                        r =_round((1 - dy)*((1 - dx)*  _red(tl) + dx*  _red(tr)) + dy*((1 - dx)*  _red(bl) + dx*  _red(br)))
                        g = _round((1 - dy)*((1 - dx)*_green(tl) + dx*_green(tr)) + dy*((1 - dx)*_green(bl) + dx*_green(br)))
                        b = _round((1 - dy)*((1 - dx)* _blue(tl) + dx* _blue(tr)) + dy*((1 - dx)* _blue(bl) + dx* _blue(br)))

                        r = r + dz
                        g = g + dz
                        b = b + dz

                        if r<0 then r = 0
                        if r>255 then r = 255
                        if g<0 then g = 0
                        if g>255 then g = 255
                        if b<0 then b = 0
                        if b>255 then b = 255

                        pset (x0 + x, y0 - a*0.707 + y), _rgb(r,g,b)
                end if
        next
        next

        _display
        _limit 50
loop until _keyhit = 27

sleep
system

sub starf(x, y, r, c)
        pset (x + r*cos(pi/2), y - r*sin(pi/2)),c
        for i = 0 to 5
                xx = r*cos(i*4*pi/5 + pi/2)
                yy = r*sin(i*4*pi/5 + pi/2)
                line -(x + xx, y - yy),c
        next
        paint (x, y),c
        for i = 0 to 5
                xx = r*cos(i*4*pi/5 + pi/2)/2
                yy = r*sin(i*4*pi/5 + pi/2)/2
                paint (x + xx, y - yy),c
        next
end sub

Print this item