Skip to main content
We’ve updated our Terms of Service. A new AI Addendum clarifies how Stack Overflow utilizes AI interactions.
Code Golf

Return to Answer

deleted 105 characters in body
Source Link
Nick Kennedy
  • 21.2k
  • 3
  • 18
  • 44

R, (削除) 122 (削除ここまで) 11071 bytes

function(w,h,p,r=rbind,q=do.call(r,lapply(p,r,NA))){plot.new();plot.window(c(0,w),c(0,h));polygon(q,c=seq(p),c=1:8)}

Try it online! Try it online!

RDRR - actually shows graphics RDRR - actually shows graphics

A function that takes arguments width, height and a list of matricesmatrix of points detailing the shapes. Each shape is separated by a row of NAs. Output is a plot to the screen of the shapes.

R, (削除) 122 (削除ここまで) 110 bytes

function(w,h,p,r=rbind,q=do.call(r,lapply(p,r,NA))){plot.new();plot.window(c(0,w),c(0,h));polygon(q,c=seq(p))}

Try it online!

RDRR - actually shows graphics

A function that takes arguments width, height and a list of matrices of points detailing the shapes. Output is a plot to the screen of the shapes.

R, (削除) 122 (削除ここまで) 71 bytes

function(w,h,p){plot.new();plot.window(c(0,w),c(0,h));polygon(p,c=1:8)}

Try it online!

RDRR - actually shows graphics

A function that takes arguments width, height and a matrix of points detailing the shapes. Each shape is separated by a row of NAs. Output is a plot to the screen of the shapes.

deleted 24 characters in body
Source Link
Nick Kennedy
  • 21.2k
  • 3
  • 18
  • 44

R, 122(削除) 122 (削除ここまで) 110 bytes

function(w,h,p,r=rbind,q=do.call(r,lapply(p,r,NA))){plot.new();plot.window(c(0,w),c(0,h));polygon(q,c=rainbow(lengthc=seq(p)))}

Try it online! Try it online!

RDRR - actually shows graphics RDRR - actually shows graphics

A function that takes arguments width, height and a list of matrices of points detailing the shapes. Output is a plot to the screen of the shapes.

R, 122 bytes

function(w,h,p,r=rbind,q=do.call(r,lapply(p,r,NA))){plot.new();plot.window(c(0,w),c(0,h));polygon(q,c=rainbow(length(p)))}

Try it online!

RDRR - actually shows graphics

A function that takes arguments width, height and a list of matrices of points detailing the shapes. Output is a plot to the screen of the shapes.

R, (削除) 122 (削除ここまで) 110 bytes

function(w,h,p,r=rbind,q=do.call(r,lapply(p,r,NA))){plot.new();plot.window(c(0,w),c(0,h));polygon(q,c=seq(p))}

Try it online!

RDRR - actually shows graphics

A function that takes arguments width, height and a list of matrices of points detailing the shapes. Output is a plot to the screen of the shapes.

Source Link
Nick Kennedy
  • 21.2k
  • 3
  • 18
  • 44

R, 122 bytes

function(w,h,p,r=rbind,q=do.call(r,lapply(p,r,NA))){plot.new();plot.window(c(0,w),c(0,h));polygon(q,c=rainbow(length(p)))}

Try it online!

RDRR - actually shows graphics

A function that takes arguments width, height and a list of matrices of points detailing the shapes. Output is a plot to the screen of the shapes.

AltStyle によって変換されたページ (->オリジナル) /