回 帖 发 新 帖 刷新版面

主题:黑客帝国之矩阵

dos下显示和黑客帝国中的绿色矩阵刷屏的效果
难度是不是大了??

回复列表 (共27个回复)

沙发

不能的...

板凳

为什么啊

3 楼

我想可以.不过因为QB的速度问题,有可能效果会差很多.

4 楼

最多这样:

cls
randomize timer
for i=1 to 1000000
a=int(nd*2)
print a; "  ";:
if a=1 then a1=a1+1 else a0=a0+1
next i
print a1,a0

5 楼

我做出来了.

[img]http://hoker.58shop.com/bbs/UploadFile/20041192013687085.jpg[/img]

[url=http://hoker.58shop.com/bbs/dispbbs.asp?boardid=2&id=748&star=1#748]我在火客BBS上的帖[/url]

6 楼

'*****************************************************
'* File name: Matrix.bas                             *
'* Author:    JingTao                                *
'* Update:    2004/01/19                             *
'*         A matrix text stream demo program         *
'*                                                   *
'*****************************************************

Const MatrixTextStreamLength% = 15  'REM 0<It<MaxColor
Const LowestSpeed! = 0.3            'REM The lowest speed
Const TextStreamCount% = 20         'REM Count of text streams

Type MatrixTextStreamType
    X As Integer
    Y As Single
    Speed As Single
    Text As String * MatrixTextStreamLength
End Type

Const ScreenMode% = 12              'REM G:640*480*16, T:80*30
Const ScreenTextWidth% = 80
Const ScreenTextHeight% = 30
CONST FALSE% = 0
CONST TRUE% = NOT FALSE

DECLARE FUNCTION UpdateTextStream% (TextStream AS MatrixTextStreamType)
DECLARE SUB DisplayTextStream (TextStream AS MatrixTextStreamType)
DECLARE SUB GenerateTextStream (TextStream AS MatrixTextStreamType)
DECLARE SUB ChangeText (TextStream AS MatrixTextStreamType)
DECLARE SUB GenerateMatrixPalette ()

Dim MatrixTextStream(TextStreamCount) As MatrixTextStreamType

Screen ScreenMode
Cls

Dim Count As Integer

For Count = 1 To TextStreamCount
    GenerateTextStream MatrixTextStream(Count)
Next

GenerateMatrixPalette

While INKEY$ <> Chr$(27)
    For Count = 1 To TextStreamCount
        DisplayTextStream MatrixTextStream(Count)
        If UpdateTextStream(MatrixTextStream(Count)) Then
            GenerateTextStream MatrixTextStream(Count)
        End If
    Next
Wend

End

Sub ChangeText(TextStream As MatrixTextStreamType)

    Dim Count As Integer
    Dim TempText As String

    Randomize Timer
    For Count = 1 To MatrixTextStreamLength - 1
        TempText = TempText + Chr$(Rnd * 222 + 33)
    Next

    TextStream.Text = " " + TempText

End Sub

Sub DisplayTextStream(TextStream As MatrixTextStreamType)

    Dim Count As Integer
    Dim CharX As Integer, CharY As Single

    For Count = 1 To MatrixTextStreamLength

        CharX = TextStream.X
        CharY = TextStream.Y + Count

        If CharY < ScreenTextHeight + 1 And CharY > 1 Then
            If CharX <= ScreenTextWidth And CharX > 0 Then
                LOCATE Int(CharY), CharX
                Color (MatrixTextStreamLength - Count + 1)
                Print Mid$(TextStream.Text, Count, 1);
            End If
        End If

    Next

End Sub

Sub GenerateMatrixPalette()
    Dim Count As Integer
    Dim Red As Integer, Green As Integer, Blue As Integer

    For Count = 1 To MatrixTextStreamLength
        Red = 0
        Green = 63 - (Count - 1) * (64 / MatrixTextStreamLength)
        Blue = 63 - (Count - 1) * (64 / MatrixTextStreamLength)
        Palette Count, Red + Green * 256 + Blue * 65536
    Next

End Sub

Sub GenerateTextStream(TextStream As MatrixTextStreamType)
    
    Randomize Timer
    TextStream.X = Int(Rnd * ScreenTextWidth) + 1
    TextStream.Y = -Rnd * MatrixTextStreamLength
    TextStream.Speed = Rnd + LowestSpeed
    ChangeText TextStream

End Sub

Function UpdateTextStream%(TextStream As MatrixTextStreamType)

    TextStream.Y = TextStream.Y + TextStream.Speed
    ChangeText TextStream
    If TextStream.Y > ScreenTextHeight + 1 Then
        UpdateTextStream = True
        Exit Function
    End If
    UpdateTextStream = False

End Function

7 楼

MY GOD,也太厉害了吧!

试了半天,改了些数据,总算看懂了一些.

8 楼


9 楼


10 楼

怎么才能转VFP啊,好希望啊

我来回复

您尚未登录,请登录后再回复。点此登录或注册