Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
QB64-PE Sample Showcase
#1
A collection of QB64 samples and a little program included with them to help showcase them for everyone.  Download the archive and enjoy!

   

You'll find the pictured QB64-PE Sample Showcase.bas file inside the QB64 Samples folder, and you can compile it and run it from there.  (Just make certain that the option is set for QB64-PE to export your EXE to the source folder, or else the paths won't work.)

Note that this is still a work in progress, and it does tend to still have several little glitches in it, but I thought I'd go ahead and showcase what it's going to be now, in case anyone wanted to add samples of their own work to the list.

What's required if you want to add your own samples in here is:

For the index:
Title
Author
Tags (try to use no more than 3 or so)
Link to where it's found on the web.
And a small description.

For the source:
Along with the source code and any resource files all gathered up into one neat little subfolder for sharing.
A screenshot (in png format)

Set those things up, in the basic format you find in the folders here, and I'll be happy to add other samples into this as I go along and work all the little kinks out of it.  Wink


Attached Files
.7z   QB64-PE Samples.7z (Size: 86.86 MB / Downloads: 114)
Reply
#2
Do we get to name them? If so, in the spirit of SCREEN 0, I'd name my stuff like...

0 Notepad
0 String math
0 Space invaders
0 Transparent Windows

etc.

Hmm, I wonder where that would appear in the index Huh   Brewhhahaha! Big Grin

Pete
Reply
#3
(08-14-2022, 04:29 PM)Pete Wrote: Do we get to name them? If so, in the spirit of SCREEN 0, I'd name my stuff like...

0 Notepad
0 String math
0 Space invaders
0 Transparent Windows

etc.

Hmm, I wonder where that would appear in the index Huh   Brewhhahaha! Big Grin

Pete

Sure it would, just like the 3d-stuff all shows up in there.  I don't see why "0 Notepad" would cause any issues with the index.  Wink

Here's what an actual index entry looks like:

Code: (Select All)
[START ENTRY]
3d-balls
Antoni Gual
screensaver, 9 lines
'balls by Antoni Gual    agual@eic.ictnet.es
'for Rel's 9 LINER contest at QBASICNEWS.COM  1/2003
'------------------------------------------------------------------------

[END ENTRY]

[start code]
title
author
tag
description from here until
[end code]

The screenshot goes in the same folder as the source file, which is the same as the title.  Wink
Reply
#4
Update to showcase the author's name as well. The screen is a little more cramped now, but I can't believe I forgot and left that off.

Work in progress; what can I say?

Code: (Select All)
'QB64-PE Sample Showcase
'code by SMcNeill (c) 2022
'code is under standard MIT License -- https://en.wikipedia.org/wiki/MIT_License
'inspired by code sample archive from QB64.com which is also MIT Licensed


Type Sample_Index_Type
    title As String
    author As String
    tag As String
    description As String
End Type
'format for data files is:
'Start line                                                   [START ENTRY]
'Title                                                        This is the same as the directory name
'Author(s)
'Tag(s)
'Description
'Continue Description as needed.
'Finish Line                                                   [END ENTRY]
'All sample information is kept in the above format and organized for ease of reference and editing in any text editor.

$Color:32
Screen _NewImage(1280, 720, 32)
ReDim Shared SI(1000) As Sample_Index_Type, count
_Title "QB64-PE Sample Showcase"

Load_Sample_Index
count = count - 1
_Delay .5
_ScreenMove _Middle



screenchanged = -1
Do
    If screenchanged Then
        DisplayScreen start, selected, limit
        screenchanged = 0
    End If
    k = _KeyHit
    Select Case k
        Case 27: System
        Case 18432
            selected = selected - 1: If selected < 0 Then selected = 40
            screenchanged = -1
        Case 20480:
            selected = selected + 1: If selected > limit Then selected = 0
            screenchanged = -1
        Case Asc("N"), Asc("n")
            start = start + 40: If start > count Then start = 0
            screenchanged = -1
        Case Asc("P"), Asc("p"):
            If start = 0 Then
                start = count - 40
            Else
                start = start - 40: If start < 0 Then start = 0
            End If
            screenchanged = -1
    End Select
    _Limit 30
    _Display
Loop



Sub DisplayScreen (start, selected, limit)
    Static screenshot, blankscreen
    If blankscreen = 0 Then blankscreen = _NewImage(460, 340, 32)

    finish = start + 40: If finish > count Then finish = count
    limit = finish - start
    If selected < 0 Then selected = 0
    If selected > limit Then selected = limit

    Cls , SkyBlue
    Color Black, transparent
    Print " ###"; Tab(10); "Title"; Tab(40); "Author"; Tab(60); "Tags"; Tab(120); "Details"
    For i = start To finish
        If i = start + selected Then
            Line (0, selected * 16 + 16)-Step(770, 16), Red, BF
            If screenshot <> 0 And screenshot <> -1 Then _FreeImage screenshot
            temp$ = "./" + SI(i).title + "/screenshot.png"
            screenshot = _LoadImage(temp$, 32)
            If screenshot <> -1 Then _PutImage (800, 20)-(1260, 359), screenshot
            _Dest blankscreen
            Cls , Black
            Color White, Black
            Print SI(i).description
            _Dest 0
            _PutImage (800, 360)-(1260, 699), blankscreen
        End If
        Print i; Tab(6); Left$(SI(i).title, 25); Tab(33); Left$(SI(i).author, 25); Tab(60); SI(i).tag
    Next
    Color Red, Black
    _PrintString (20, 680), "<P>revious Page      <N>ext Page      <UP/DOWN> change selection"
End Sub


Sub Load_Sample_Index
    Open ".\index.txt" For Input As #1 'The only file we should ever have open, in all honesty.

    Do Until EOF(1)
        Line Input #1, start$
        'If start$ <> "[START ENTRY]" Then Print "ERROR Reading file.  Invalid Start Entry Point.": End
        Line Input #1, title$
        Line Input #1, author$
        Line Input #1, tag$
        description$ = "": finish$ = ""
        Do Until finish$ = "[END ENTRY]"
            Line Input #1, finish$
            finish$ = _Trim$(finish$)
            If finish$ <> "[END ENTRY]" Then description$ = description$ + finish$ + Chr$(13)
        Loop
        SI(count).title = _Trim$(title$)
        SI(count).author = _Trim$(author$)
        SI(count).tag = _Trim$(tag$)
        SI(count).description = _Trim$(description$)
        count = count + 1
    Loop

    Close
End Sub

Save the replace the other QB64 Sample Showcase.bas file in the archive and then you can compile and see the authors names now. Wink
Reply
#5
(08-14-2022, 04:42 PM)SMcNeill Wrote:
(08-14-2022, 04:29 PM)Pete Wrote: Do we get to name them? If so, in the spirit of SCREEN 0, I'd name my stuff like...

0 Notepad
0 String math
0 Space invaders
0 Transparent Windows

etc.

Hmm, I wonder where that would appear in the index Huh   Brewhhahaha! Big Grin

Pete

Sure it would, just like the 3d-stuff all shows up in there.  I don't see why "0 Notepad" would cause any issues with the index.  Wink

Here's what an actual index entry looks like:

Code: (Select All)
[START ENTRY]
3d-balls
Antoni Gual
screensaver, 9 lines
'balls by Antoni Gual    agual@eic.ictnet.es
'for Rel's 9 LINER contest at QBASICNEWS.COM  1/2003
'------------------------------------------------------------------------

[END ENTRY]

[start code]
title
author
tag
description from here until
[end code]

The screenshot goes in the same folder as the source file, which is the same as the title.  Wink

Just messing with you. Putting a zero in front would rank all my stuff ahead of 3-D balls in the current demo index. I'd call that a "modest" request, but I can't do that with a straight face. Big Grin

Nice project in all, especially as the forum grows. I might suggest having a way to arrange it by author name as well as appname, or possibly even consider using tags. It depends, I guess, how far you want to take it, or as my old pal Knewbie used to say, there are no such things as finished programs.

Pete
Reply
#6
I'm going to add a search by author and search by tag option in there soonish. Wink
Reply
#7
Nice work, Steve, now I can enjoy all my favourite B+ mods without having to descend into that dreaded dot com
Reply
#8
(08-14-2022, 07:50 PM)vince Wrote: Nice work, Steve, now I can enjoy all my favourite B+ mods without having to descend into that dreaded dot com

Or even better -- while offline!
Reply
#9
Updated the archive in the original post to take advantage of the latest changes.
Author names are now listed on the select screen.
You can now select samples from more than just the first screen.
The internal testing variable which capped samples to 100 has been removed. All 280ish samples are now browsable from the selection screen.
Added detail information for more of the samples -- all of the A's are now completed. (I'll add more of these over time, when I'm just wasting time and not really working on anything else. Formatting isn't the prettiest for these atm, and there's no word wrap or scrolling, but we're still a work in progress and I'm just one poor programmer working on sorting out one thing at a time here. Wink )

Grab the latest version and test things out, and if anyone wants to add something of their own to the lists here, feel free to work them up and post the relevant source code, screenshot, and index information, and I'll add your stuff into the demo as well when I release another version. Wink
Reply
#10
That looks real similar to the samples page on qb64.com:  https://qb64.com/samples.html
Reply




Users browsing this thread: 3 Guest(s)