今日のp5.rbでのコーディングあそび
def setup
createCanvas(1280, 720)
colorMode(HSB, width, width, height, 100)
background(20)
end
def draw
stroke(
rand(0..width),
rand(0..width),
rand(0..height)
)
50.times do |i|
strokeWeight(random(1, 1, 1, 2, 3))
line(
mouseX + rand(-50..50),
mouseY + rand(-50..50) ,
rand(0..width),
rand(0..height)
)
end
end
def setup
createCanvas(1280, 720)
colorMode(HSB, width, width, height, 100)
background(20)
100000.times do |i|
stroke(
rand(0..width),
rand(0..width),
rand(0..height)
)
strokeWeight(rand(1..4))
line(
0,
0,
rand(0..width),
rand(0..height)
)
end
end
今日は前回までのとは別として、線を引っ張って遊んでいました