Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
perl plot circular list in a circle
#perl 5.22.1 my @plotArea = (); push @plotArea, [(" ") x 60,"\n"] foreach (0..20); circle([1..6]); sub circle{ my $circleList=shift; my $center=[11,22]; my $radius=[10,18]; foreach my $angle (0..@$circleList-1){ $plotArea [$$center[0]+$$radius[0]*sin($angle*6.28/@$circleList)] [$$center[1]-$$radius[1]*cos($angle*6.28/@$circleList)] =$$circleList[$angle]; } print @{$_} foreach (@plotArea); }
run
|
edit
|
history
|
help
0
array flipper
exam ata
101744
Basics
Cheat attractive
Perl logo
Sort
Quotes
Array_range_operators
Hello