H.to_i.times do |i| case C when "B" then str = (i + 1).odd?? "BW": "WB" when "W" then str = (i + 1).odd?? "WB": "BW" end puts (str * width)[0, width] end