2
\$\begingroup\$

It's geeky to see a Boolean Matrix animation, but a live one would be better. Echoing only 1s and 0s create a program that creates an infinite loop of integer matrix.

  • 1s and 0s are randomly echoed like an error.

  • Illustaration

\$\endgroup\$

closed as unclear what you're asking by John Dvorak, Dr. belisarius, Donarsson, Peter Taylor, ugoren Feb 25 '14 at 12:39

Please clarify your specific problem or add additional details to highlight exactly what you need. As it's currently written, it’s hard to tell exactly what you're asking. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question.

  • 1
    \$\begingroup\$ Please clarify. First, what does "like an error" mean? Second, what counts as "predefined functions to randomise the output", and what source of randomness are we allowed to use? \$\endgroup\$ – John Dvorak Feb 25 '14 at 11:34
  • \$\begingroup\$ I think I just don't have to mention that, "predefined functions to randomise the output", sorry for that... \$\endgroup\$ – Dadan Feb 25 '14 at 11:58
  • \$\begingroup\$ "Using only 1s and 0s create a program ..." ... that means binary coding ... \$\endgroup\$ – Dr. belisarius Feb 25 '14 at 12:11
  • \$\begingroup\$ :D Thanks for that I didn't noticed, I'm glad you commented \$\endgroup\$ – Dadan Feb 25 '14 at 12:14
  • \$\begingroup\$ @Daniel, I suggest that you read some questions on this site, read some answers, and write some answers of your own. When you understand better what makes a good question, try to rewrite this one. \$\endgroup\$ – ugoren Feb 25 '14 at 13:22
3
\$\begingroup\$

Like this?

PHP, 28 22

for(;;)echo rand(0,1);

For a better view:

<div style="width:800px;margin:0 auto;background-color:black;color:green;">
    <?php for(;;)echo rand(0,1); ?>
</div>
\$\endgroup\$
  • \$\begingroup\$ i wonder if you can use for(;;) instead of while(true) \$\endgroup\$ – ace Feb 25 '14 at 12:56
  • \$\begingroup\$ Sure, you're right! Edited :) I also removed brackets. \$\endgroup\$ – Vereos Feb 25 '14 at 13:40
2
\$\begingroup\$

Delphi XE3 (30 28)

while 0<1do write(Random(2))
\$\endgroup\$
  • 2
    \$\begingroup\$ I don't know Delphi, but can you use 0<1 to replace true? \$\endgroup\$ – ace Feb 25 '14 at 12:57
  • \$\begingroup\$ Yes I can, thanks :) \$\endgroup\$ – Teun Pronk Feb 25 '14 at 13:00
  • \$\begingroup\$ Can't you use while 1 in delphi? \$\endgroup\$ – Mhmd Feb 25 '14 at 18:06
  • \$\begingroup\$ @user689 Nope, it requires a boolean expression. \$\endgroup\$ – Teun Pronk Feb 26 '14 at 7:48
0
\$\begingroup\$

TI-BASIC, 46

A classic, in my opinion.

"101010101010101":While 1:Disp Ans,"0"+Ans:End
\$\endgroup\$
  • \$\begingroup\$ doesn't seem very random. It's mostly zeroes. \$\endgroup\$ – John Dvorak Feb 25 '14 at 11:50
0
\$\begingroup\$

Perl, 24

print-+-(rand>.5)while+1
\$\endgroup\$
0
\$\begingroup\$

C# 112 - 109 Thanks @masterX244

using System;namespace N{class P{static void Main(string[]a){for(;;)Console.Write(new Random().Next(0,2));}}}

Without namespace, class name...

45

for(;;)Console.Write(new Random().Next(0,2));

Uncompressed

using System;namespace N{class P{
        static void Main(string[] a) {
            for (;;)
                Console.Write(new Random().Next(0, 2));
        }
    }
}
\$\endgroup\$
  • \$\begingroup\$ for(;;) is shorter btw \$\endgroup\$ – masterX244 Feb 25 '14 at 13:09

Not the answer you're looking for? Browse other questions tagged or ask your own question.