Jump to content

Draw a sphere: Difference between revisions

m
→‎Pure Perl 6: fix file open error handling
m (→‎Pure Perl 6: fix whitespace)
m (→‎Pure Perl 6: fix file open error handling)
Line 2,857:
sub MAIN ($outfile = 'sphere-perl6.pgm') {
spurt $outfile, "P5\n$width $height\n$depth\n"; # .pgm header
my $out = open( $outfile, :a, :bin ) ororelse .die "$!\n";
$out.write( Blob.new(draw_sphere( ($width-1)/2, .9, .2) ) );
$out.close;
2,392

edits

Cookies help us deliver our services. By using our services, you agree to our use of cookies.