Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Matrix
#31
I made one last matrix thing, just for old time's sake. Wink

Code:
#Include "fbgfx.bi"
Randomize Timer
Screenres 640, 480, 32,, GFX_FULLSCREEN

Type Char
    X As Single
    Y As Single
    Spd As Single
    Id As Integer
End Type

Dim Array( 1 To 40) As Char
Dim As Integer i, Xoro
Dim As String*1 Ink

For i = 1 To Ubound(Array)
    Array(i).X = Int(Rnd*80) + 1
    Array(i).Y = Int(Rnd*10) + 1
    Array(i).Spd = Rnd+.05
    Array(i).Id = Int(Rnd*2)
Next

Do
    Ink = Inkey$
    
    For i = 1 To Ubound(Array)
        Array(i).Y += Array(i).Spd
        Array(i).Id Xor = 1
        
        Dim As Integer i2  
        For i2 = 0 To 12
            Dim As Integer ny  = Int(Array(i).Y+i2)
            Dim As Integer col = 16+(i2*16)
            Color(Rgb(0,col,0))
            
            If ny>0 And ny<59 Then
                Locate ny, Array(i).X
                If ny = INT(Array(i).Y) Then
                    Print LTRIM$(Str$(Array(i).Id))
                Else
                    Dim As integer tchar = Screen(ny, Array(i).x)
                    Print Chr$(tchar)
                End If
            End If
        Next
        
        If Array(i).Y>60 Then
            Dim As Integer ci            
            Dim As Integer tRand
            Do
                tRand = Int(Rnd*80) + 1
                Array(i).X = tRand
                For ci=1 To Ubound(Array)
                    If Array(ci).X = tRand Then
                        If ci<>i then
                            tRand = -100
                        End If
                    End If
                Next
            Loop Until Array(i).X = tRand
            Array(i).Y = -12
            Array(i).Spd = Rnd+.05
            Array(i).Id = Int(Rnd*2)
        End If
    Next
    
    Sleep 20
    
Loop Until Ink = Chr$(27)
Reply
#32
Dr_:

I copied your "last matrix thing" program into my FBIde 0.4.2, and I get an error message:
line 32: Error 11 Expected constant
Dim As Integer ny = Int(Array(i).Y+i2)

Same for line 33, and similar.

Is it my FBIde?
Ralph, using QuickBASIC 4.5 and Windows XP Home Edition and Service Pack 2, with HP LaserJet 4L printer.
Reply
#33
Hmmm... It probably is. What version of fbc are you compiling with?
Reply
#34
Dr_:

Don't know how to find out its version. Under Properties, it says:
Created: Saturday, July 23, 2005, 1:10:00 PM
Ralph, using QuickBASIC 4.5 and Windows XP Home Edition and Service Pack 2, with HP LaserJet 4L printer.
Reply
#35
Hmmm... Not sure how to do that from FBIDE. From the command prompt, you can just...


Code:
fbc -version


...and it will list the version. Wink
Reply
#36
Dr_

Thanks. I see te version as 0.14 Is that bad? What is the current "last"version? And, if I download a newer version, can I simply ovewrite the old one, or do I have to uninstall, etc.?
Ralph, using QuickBASIC 4.5 and Windows XP Home Edition and Service Pack 2, with HP LaserJet 4L printer.
Reply
#37
Well, you could always just download the newer version of fbc, and leave FBIDE the way it is.

Download this, and unpack it over the original FreeBASIC installation. Don't worry though... If it get's borked somehow, you can always reinstall the old fbide package.
Reply
#38
Dr_:

I downloaded version 0.16 into a new folder, put your file there, too, and entered, in the MSDOS window, FBC Matrix-Dr.TXT, which ended up giving me Matrix_Dr.exe. I ran it as an exe, and, it ran fine! Big Grin

Thanks for the help.
Ralph, using QuickBASIC 4.5 and Windows XP Home Edition and Service Pack 2, with HP LaserJet 4L printer.
Reply
#39
Cool... Glad you got it to work. Tongue Too bad you can't attach n.exe files to posts! hehehe
Reply
#40
Say, is there a FBIde.exe that will work for FBC.exe ver 0.16? I sort of like the Ide, it's nice, and reminds of QuickBASIC ver 4.5.

Signing out, as it is now 11:48 pm, here in Katy, Texas. Good night, Dr_
Ralph, using QuickBASIC 4.5 and Windows XP Home Edition and Service Pack 2, with HP LaserJet 4L printer.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)