Cleaning
This commit is contained in:
		
							parent
							
								
									e8f4923de1
								
							
						
					
					
						commit
						9de4fa6ebd
					
				
							
								
								
									
										8
									
								
								day4.p8
									
									
									
									
									
								
							
							
						
						
									
										8
									
								
								day4.p8
									
									
									
									
									
								
							| 
						 | 
					@ -245,20 +245,16 @@ local iter = cocreate(function()
 | 
				
			||||||
    local count = 0
 | 
					    local count = 0
 | 
				
			||||||
    for j, v in ipairs(mine) do
 | 
					    for j, v in ipairs(mine) do
 | 
				
			||||||
      if contains(winning, v) then
 | 
					      if contains(winning, v) then
 | 
				
			||||||
        count = count + 1
 | 
					        count +=  1
 | 
				
			||||||
        -- yay exponential growth
 | 
					        -- yay exponential growth
 | 
				
			||||||
        copies[i + count] = strdsum(copies[i + count], tostr(copies[i]))
 | 
					        copies[i + count] = strdsum(copies[i + count], tostr(copies[i]))
 | 
				
			||||||
        -- lne(1, 0, 1, 10, 7)
 | 
					 | 
				
			||||||
        -- pset(i, count, 7)
 | 
					 | 
				
			||||||
        -- print(count)
 | 
					 | 
				
			||||||
        -- circ(i%128, count*10, 1, 7)
 | 
					 | 
				
			||||||
        line(i % 128, 0, i % 128, count * 10 + 10, 11)
 | 
					        line(i % 128, 0, i % 128, count * 10 + 10, 11)
 | 
				
			||||||
        yield()
 | 
					        yield()
 | 
				
			||||||
      end
 | 
					      end
 | 
				
			||||||
    end
 | 
					    end
 | 
				
			||||||
    printh("  " .. count .. " winning cards")
 | 
					    printh("  " .. count .. " winning cards")
 | 
				
			||||||
    if count > 0 then
 | 
					    if count > 0 then
 | 
				
			||||||
      count = count - 1
 | 
					      count -=  1
 | 
				
			||||||
      -- printh(2 ^ count)
 | 
					      -- printh(2 ^ count)
 | 
				
			||||||
      sum = strdsum(sum, tostr(2 ^ count))
 | 
					      sum = strdsum(sum, tostr(2 ^ count))
 | 
				
			||||||
    end
 | 
					    end
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
		Reference in New Issue
	
	Block a user