Software developer and artist.

  • 2 Posts
  • 94 Comments
Joined 1 year ago
cake
Cake day: June 5th, 2023

help-circle



  • Nice and easy.

    Lua
    -- SPDX-FileCopyrightText: 2023 Jummit
    --
    -- SPDX-License-Identifier: GPL-3.0-or-later
    
    local function nums(str)
    	local res = {}
    	for num in str:gmatch("%d+") do
    		res[num] = true
    	end
    	return res
    end
    
    local cards = {}
    local points = 0
    for line in io.open("4.input"):lines() do
    	local winning, have = line:match("Card%s*%d+: (.*) | (.*)")
    	winning = nums(winning)
    	have = nums(have)
    	local first = true
    	local score = 0
    	local matching = 0
    	for num in pairs(have) do
    		if winning[num] then
    			matching = matching + 1
    			if first then
    				first = false
    				score = score + 1
    			else
    				score = score * 2
    			end
    		end
    	end
    	points = points + score
    	table.insert(cards, {have=have, wins=matching, count=1})
    end
    print(points)
    
    local cardSum = 0
    for i, card in ipairs(cards) do
    	cardSum = cardSum + card.count
    	for n = i + 1, i + card.wins do
    		cards[n].count = cards[n].count + card.count
    	end
    end
    print(cardSum)
    

  • Ich weiß, das kommt hier nicht gut an, aber meiner Meinung nach hat sich schon länger erwiesen dass Wählen allein keine ausreichende Lösung für Probleme die mit Menschenrechten, Umwelt oder Lebensqualität zu tun haben ist. (Ich meine nicht Demokratie oder Wahlen generell, sondern unsere Bundestagswahl). Wir sind zwar besser dran als viele andere, aber ich denke Emma Goldman hatte mehr Recht als man zugeben möchte: “If voting changed anything, they’d make it illegal”















  • If this is how everyone would act in their daily life, you would see crime, theft and abuse on an unimaginable level. No, people don’t always do what benefits them “at every individual point”. We are social creatures, acting as a community where the individuals benefit from working together. Although this has been successfully undermined by capitalism and other hierarchies.

    This whole concept is also called, the Prisoner’s Dilemma, one of my favorite thought experiments because it shows how being rational can result in everyone being worse off.


  • Yes. The “tragedy of the commons” is a myth.

    Without any limits, individual cattle owners have an incentive to overgraze the land, destroying its value to everybody.

    This is factually false, because the land will be destroyed and individuals don’t benefit, not even in the short term. Commons work great (see open source software), but capitalism and power structures abuse and destroy them for short-term profit.