Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Matrix
#11
Here... I ran this through the Sooper Dooper Code Scrambler, and this is what popped out! :lol:

Code:
Randomize Timer
ScreenRes 640,480,32,,1
NumberOfLetters = 50

Dim letters(NumberOfLetters, 3) '0 is xpos, 1 is ypos, 2 speed, 3 is character

For i = 1 To NumberOfLetters
    letters(i, 0) = Int(Rnd * 79) + 1
    letters(i, 1) = Int(Rnd * 10) + 1
    letters(i, 2) = Rnd * 1.5 + .1
    If Int(Rnd * 2) = 0 Then
        letters(i, 3) = 48 'ascii character number
    Else
        letters(i, 3) = 49
    End If
Next

Dim OldTime As Single
Dim Ink As String*1
Dim As Integer i2, newY


Do
    Ink = Inkey$
    For i = 1 To NumberOfLetters
        letters(i, 1) = letters(i, 1) + letters(i, 2)
        
        For i2 = 6 To 0 Step -1
            newY = Letters(i,1)+i2
            If newY>0 and newY< 60 Then
                Color RGB(0,64+i2*24,0)
                Locate newY, letters(i, 0)
                Print Chr$(letters(i, 3))
            End If
        Next
                
        
        If letters(i, 1) > 59 Then
                letters(i, 1) = Int(Rnd * 79) + 1
                letters(i, 1) = 1
                letters(i, 2) = Rnd * .9 + .1
                If Int(Rnd * 2) = 0 Then
                    letters(i, 3) = 48
                Else
                    letters(i, 3) = 49
                End If
        End If
    Next
    
    Oldtime = Timer +.1
    Do
    Loop Until Timer > OldTime
Loop While Ink<>Chr$(27)
Reply
#12
Oh man I hate Calc basic. Makes me want to scream. So frusterating. Thats why instead during class I go through QB programs in this QB textbook I have and execute them line by line. I played one round of a 21 game with myself once. Only once cause it took 2 days to shuffle the deck. :b
-yah
Reply
#13
Manwë:

Here is one type of wavy program. Try it out and give us your comments.

Code:
'MsgWavy.BAS
RANDOMIZE TIMER
CLS
DIM x AS INTEGER, y AS INTEGER


W = 80
H = 51

Test = 1
Msg$ = "ABCDEFGHIJKLMNOPQ" 'deault message

IF Test = 0 THEN
  INPUT " Enter text for wavy message", Msg$
END IF

'create a matrix with the message characters
MsgLen = LEN(Msg$)
DIM Letter$(MsgLen)
FOR i = 1 TO MsgLen
  Letter$(i) = MID$(Msg$, i, 1)
NEXT i

x = INT(RND * 80) + 1 - MsgLen
y = INT(RND * 50) + 1 - MsgLen


'draw message in wavy form
FOR i = 1 TO 1000
  x = x + 1: x1 = x
  y = y + 1: y1 = y
  FOR j = 1 TO MsgLen
    y = y + (-1) ^ (INT(RND * 2))
      IF y < 1 THEN y = 1
      IF y >= H THEN y = 1
    x = x + 1
      IF x >= W THEN x = 1
    LOCATE y, x
    PRINT Letter$(j)
    FOR k = 1 TO 100000: NEXT k
  NEXT j
  x = x1 + 1: IF x > W THEN x = 0
  y = y1: IF y > H THEN y = 2
  FOR k = 1 TO 600000: NEXT k
  CLS
NEXT i
Ralph, using QuickBASIC 4.5 and Windows XP Home Edition and Service Pack 2, with HP LaserJet 4L printer.
Reply
#14
could look good, but when i run it it says "Illegal funcion call" and marks
Code:
LOCATE y, x

btw, nixtons vearson of 'Matrix' seemed relly good, only need to add a bit more letters Tongue
color=darkred]Imperishable flames are mine to controll![/color]
Reply
#15
Manwë:

Thank you for trying out my code, and reporting the error you found. With that information, I found that the error occurs when x is negative, which I had missed taking into account. The fix is easy. Please insert a new line, two lines above the line that reads
Code:
LOCATE y,x
as follows:
Code:
IF x< 1 THEN x = 1

Another, possible broblem: I currently have the visible number of rows set to 51, at the beginning, where I set
Code:
W=80
H=51
If that should turn out to be a problem, please change the number of rows from 51 to either 23 or 24 or 25.

I know that this is not exactly what you want, when you first described it as
Quote:-How to make it look like a matrix code runs over the screen (you
know, all the numbers and letters "falling" down in "snakes")
I only made up this program to give you a good start. Now, if you put some thought into it, you should be able to arrive at the necessary coding to come up with your final desire!

By the way, remember that anything you have no interest in is "boring". Perhaps, if you try to get interested in your school work, you may start to really like that "stuff", and, then, you not only will not be bored, but, you will be happy learning all the new things that exist in life, and which school is just meant to sort of set you on the path towards knowledge. Never let a bad or boring teacher ruin your liking of a subject; just learn as much as you can, and, during those impossible, boring lectures, let your mind dwell a little on how to solve that last problem in your current, QuickBASIC program Big Grin

Finally, let me widh you good luck in your current endevour, and, keep us posted on your positive advances.
Ralph, using QuickBASIC 4.5 and Windows XP Home Edition and Service Pack 2, with HP LaserJet 4L printer.
Reply
#16
ok, thanks, I'll have a close look at the code over the weekend, (going away in the weekend)
color=darkred]Imperishable flames are mine to controll![/color]
Reply
#17
Are you using a TI calculator? If so, I'd like to see your code.
In the beginning, there is darkness – the emptiness of a matrix waiting for the light. Then a single photon flares into existence. Then another. Soon, thousands more. Optronic pathways connect, subroutines emerge from the chaos, and a holographic consciousness is born." -The Doctor
Reply
#18
TI calculator?
I use a Casio CFX-9850G...
the code i've made so far is quite poor, I've had some troubles with my DOS emulator, so I've had little time to look at the codes posted here (Downloaded FreeDOS last night hope it will work better)

but the code so far is:
Code:
locate 5,5,"press exe" /   'a sign i'm not able to make on the comp
1->Y
ClrText
do
Y+1->Y
for 1->X to 21 Step 2
locate X,5,"  ===>"
next
for 1->R to 21 Step 2
locate R,4,"  ===>"
next
for 1->S to 21 Step 5
locate S,2,"     ===>"
next
for 1->T to 21 Step 2
locate T,7,"  ===>"
next
for 1->Q to 21 Step 3
locate Q,4,"   ===>"
next
LpWhile Y<11

Yes, I do know it's clumsy (and that signs might be able to make on comp), but, as ralph said, I have to pay some attention to the classes too, so this is how far (or short) I've gotten.
color=darkred]Imperishable flames are mine to controll![/color]
Reply
#19
I have a TI-83+ and I was trying to use Nixon's example but I'm having trouble calling elements with a variable- e.g.

Code:
I = 1
disp L1(I)

Oh well, I'll figure something out...
In the beginning, there is darkness – the emptiness of a matrix waiting for the light. Then a single photon flares into existence. Then another. Soon, thousands more. Optronic pathways connect, subroutines emerge from the chaos, and a holographic consciousness is born." -The Doctor
Reply
#20
well, the calculators aren't all alike, but this might be the same, as u can see from my example above I set the variables by using an arrow
Code:
->
If your calculator isn't too different from mine there should be a key with an arrow on, pointing right, the code would be like this:
Code:
1 -> I



PS.
Ralph:

I input the line u said, and the program runned for a bit (here is where I saw why u posted it Wink ) but after the "snake of letters" has "crawled" for a few seconds it stops at the same line
Code:
LOCATE  y , x
color=darkred]Imperishable flames are mine to controll![/color]
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)