mirror of
https://github.com/coding-horror/basic-computer-games.git
synced 2025-12-31 23:17:38 -08:00
Create sinewave.pl
Sinewave.bas converted to Perl.
This commit is contained in:
17
78 Sine Wave/perl/sinewave.pl
Normal file
17
78 Sine Wave/perl/sinewave.pl
Normal file
@@ -0,0 +1,17 @@
|
||||
#!/usr/bin/perl
|
||||
use strict;
|
||||
use warnings;
|
||||
|
||||
print ' ' x 30 ."SINE WAVE\n";
|
||||
print ' ' x 15 ."CREATIVE COMPUTING MORRISTOWN, NEW JERSEY\n";
|
||||
print "\n\n\n\n\n";
|
||||
|
||||
my $B=0;
|
||||
|
||||
for (my $T=0; $T<40; $T+=.25) {
|
||||
my $A=int(26+25*sin($T));
|
||||
print ' ' x $A;
|
||||
if ($B==0) { print "CREATIVE\n"; }
|
||||
if ($B==1) { print "COMPUTING\n"; }
|
||||
$B= !$B; #Toggle
|
||||
}
|
||||
Reference in New Issue
Block a user