Author Topic: Matrix Console Screen  (Read 3167 times)

0 Members and 1 Guest are viewing this topic.

Offline Hotshot

  • DBF Aficionado
  • ******
  • Posts: 2114
  • Karma: 91
    • View Profile
Matrix Console Screen
« on: January 05, 2009 »
Code: [Select]
Dim As Integer x,y,choice

Locate 25,55
Print "press Esc key to exit...";       
   
Do         
    x=Rnd * 80
    Y=Rnd * 25
   
    Locate y,x
   
    choice=Rnd(1)
       
    Select Case As Const Choice
            Case 0
                    Color 10
                    Print "1";                   
            Case 1
                    Color 2
                    Print "0";
        End Select
   
Loop Until  Inkey = Chr(27)

 :)

Online Shockwave

  • good/evil
  • Founder Member
  • DBF Aficionado
  • ********
  • Posts: 17414
  • Karma: 498
  • evil/good
    • View Profile
    • My Homepage
Re: Matrix Console Screen
« Reply #1 on: January 05, 2009 »
Cool :)

Use the extended ascii set and scroll them down the screen and it will look pretty authentic :)
Shockwave ^ Codigos
Challenge Trophies Won:

Offline bikerboy

  • Amiga 1200
  • ****
  • Posts: 349
  • Karma: 12
    • View Profile
Re: Matrix Console Screen
« Reply #2 on: January 05, 2009 »
it looks nice and it surely could be imroved with some other characters and motion.

continue coding ;)

Ps. you forgot to put it to sleep :P

Code: [Select]
End Select
   
Loop Until  Inkey = Chr(27)

should be
Code: [Select]
End Select
sleep 1
Loop Until  Inkey = Chr(27)

or this one (correct me someone if i'm wrong with this, it's the first time i'm doing it)

Code: [Select]
DIM SHARED AS DOUBLE OLD,DV
Dim As Integer x,y,choice
        Locate 25,55
        Print "press Esc key to exit...";       
   
Do   
    x=Rnd * 80
    Y=Rnd * 25
   
    Locate y,x
   
    choice=Rnd(1)
    OLD=TIMER 
    Select Case As Const Choice
            Case 0
                    Color 10
                    Print "1"                 
            Case 1
                    Color 2
                    Print "0"
        End Select
        sleep 1
        DV=TIMER-OLD
Loop Until  Inkey = Chr(27)
« Last Edit: January 05, 2009 by bikerboy »


Online Shockwave

  • good/evil
  • Founder Member
  • DBF Aficionado
  • ********
  • Posts: 17414
  • Karma: 498
  • evil/good
    • View Profile
    • My Homepage
Re: Matrix Console Screen
« Reply #3 on: January 05, 2009 »
Sleep (time in millisecs) pauses your program and returns some time to the operating system, it's good practice to do this as Bikerboy said.
Shockwave ^ Codigos
Challenge Trophies Won: