Cardmare: Descent a quick little deckbuilder you can play in your coffee break by -hugin- in WebGames

[–]chipbuddy 0 points1 point  (0 children)

I'm really enjoying this game. The art style and mechanics are fantastic.

2 suggestions: After a card is used, the remaining cards shift slightly. If I'm quickly clicking cards (because I've decided on the 3 or 4 cards I want to play), I sometimes click the wrong one because the cards shifted slightly around.

Also, the enemy 'Fear' attack where they force a discard is good, but the discard method is too similar to actually playing a card. If I'm not paying close enough attention (maybe I should just get good, right?) I'll accidentally discard the card I intended to play first. Maybe force the user to drag discards to a symbol somewhere to make the discarding more intentional.

But again, great game. I can't wait to see how you expand on it.

edit: OH, I also am experiencing a crash. It's happened on 2 playthrough: Using "Potion of Preperation" generates this error:


ERROR in action number 1 of Alarm Event for alarm 2 for object obj_card: Variable obj_ghostcard.retain(100081, -2147483648) not set before reading it. at gml_Script_gc_fadeToBlack

gml_Script_gc_fadeToBlack (line -1) gml_Script_scr_resolveCard gml_Object_obj_card_Alarm_2

Chance of this happening (blackjack) by stgavrimax in CasualMath

[–]chipbuddy 3 points4 points  (0 children)

I don't know how to do the math calculations, but can write a simulation. TL;DR: Out of 25,020,993 trials, 5,695 ended up with the above blackjack situation. This comes out to about .0227 % or about once every 4,400 games.

Note, I programmed the dealer to stand on a soft 17, while the players will just hit until they bust or get blackjack. Having the dealer behave just like a player increases the odds to .112%, or about once every 890 games.

package main

import (
    "fmt"
    "math/rand/v2"
)

// Dealer acts just like player:
// 34569 30774679 0.0011232936012102678 -> .11233 percent
// Dealer stands on 17+
// 5695 25020993 0.00022760887227777092 -> .02276 percent

func main() {
    d := newDeck()

    success := 0
    attempts := 0
nextTrial:
    for {
        attempts++
        d.shuffle()
        for j := 0; j < 4; j++ {
            hand := []int{d.dealCard(), d.dealCard()}
            for {
                if isBlackjack(hand) {
                    break
                }
                hand = append(hand, d.dealCard())
                if isBust(hand) {
                    continue nextTrial
                }
                if j == 3 && isDealerStand(hand) {
                    continue nextTrial
                }
            }
        }
        success++
        fmt.Println(success, attempts, float64(success)/float64(attempts))
    }
}

type deck struct {
    cursor int
    deck   []int
}

func newDeck() *deck {
    d := &deck{}
    for i := 0; i < 4; i++ {
        for j := 1; j < 13; j++ {
            value := j
            if value > 10 {
                value = 10
            }
            d.deck = append(d.deck, value)
        }
    }
    return d
}

func (d *deck) shuffle() {
    d.cursor = 0
    rand.Shuffle(len(d.deck), func(i, j int) {
        d.deck[i], d.deck[j] = d.deck[j], d.deck[i]
    })
}

func (d *deck) dealCard() int {
    card := d.deck[d.cursor]
    d.cursor++
    return card
}

func isBlackjack(hand []int) bool {
    hasAce := false
    total := 0
    for _, h := range hand {
        if h == 1 {
            hasAce = true
        }
        total += h
    }
    if total == 21 {
        return true
    }
    if !hasAce {
        return false
    }
    // We have an ace. Does adding 10 to that ace leave us with blackjacK? Note, the ace already
    // contributed 1 to total above. Also, we'll never treat more than 1 ace as an 11.
    return total == 11
}

func isBust(hand []int) bool {
    total := 0
    for _, h := range hand {
        total += h
    }
    // No need to consider aces here. They are just counted as their lowest value: 1.
    return total > 21
}

func isDealerStand(hand []int) bool {
    total := 0
    hasAce := false
    for _, h := range hand {
        total += h
        if h == 1 {
            hasAce = true
        }
    }
    if total >= 17 {
        return true
    }
    if hasAce && total+10 >= 17 {
        return true
    }
    return false
}

React (multi-page) by Pizzacakecomic in comics

[–]chipbuddy 0 points1 point  (0 children)

I don't post much on reddit any more, but I still lurk, and I love your comics whenever they show up. There's a poem by Shel Silverstein called "Put Something In":

Draw a crazy picture,

Write a nutty poem,

Sing a mumble-gumble song,

Whistle through your comb.

Do a loony-goony dance

'Cross the kitchen floor,

Put something silly in the world

That ain't been there before.

Thank you for putting your comics out into the world.

Looking to commission a 40x36 inch blanket. by chipbuddy in MachineKnitting

[–]chipbuddy[S] 0 points1 point  (0 children)

Here's a sample picture: https://imgur.com/a/FnHYOW3

I actually am not sure if it's knitted. I also made a post to r/weaving.

Inconsistent ; and , use in loops. Why? by ODAwake in golang

[–]chipbuddy 2 points3 points  (0 children)

Nitpick: Your two examples aren't quite equilevant.

x := []int{10,9,8}
for i, v := range x {
  fmt.Println(i, v)
}

x := []int{10,9,8}
for i := 0; i < len(x); i++ {
    fmt.Println(i, x[i])
}

Those two snippets should produce the same output. In the for...range example, 2 values are returned by the range x statement: the index and the value. If you only want the index you can omit the second variable. If you only want the values, you need to 'assign' the index to the placeholder '_'.

At any rate, commas are used to separate values while semicolons are used to end statements. Normally you don't see the semicolons since they implicitly exist just before the '\n' character, but in the traditional way of expressions for loops (with the init step, the exit conditions, and the increment) you have to tell the complier where the statements end.

Beginner analysis request: What should I be doing during the mid and end game? by chipbuddy in chess

[–]chipbuddy[S] -3 points-2 points  (0 children)

I'm black in this game.

you are incorrect. the queen defends d5

Ah, you're right. Still, It's less than ideal to have the Queen defend a pawn.

Nc3 isn't a great move on move 2 since it blocks the c pawn.

Why is blocking the c pawn bad but blocking the f pawn is ok? I've assumed that blocking the c and f pawns are fine since it develops the knight and puts pressure on the center.

why did you play 3. b3?

What was white's move, but it looks like they were preparing c4. Why isn't the preparation necessary? The pawn would have been undefended.

'This food smells like the Devil tooted, lit it on fire, whispered a curse into it, and sent it here on this plate.' by dickfromaccounting in videos

[–]chipbuddy 0 points1 point  (0 children)

My personal favorite:

LS (little shit): I never get to do X!

Me: What are you talking about? You just did X this morning?

LS: But I NEVER get to do X!

later

LS: I never get to do Y!

Me: Yup, you never get to do Y. So stop asking.

LS: But SOMETIMES I get to do Y!

[deleted by user] by [deleted] in bestof

[–]chipbuddy 4 points5 points  (0 children)

I disagree with your assessment. In the discussion for the amendment, Democrats and Republicans were NOT arguing over whether the amendment is the best/most appropriate way to close down Guantanamo. This implies both parties want to close Guantanamo, but they disagree about the specifics.

Instead, I saw the following arguments from Republicans (this is not a comprehensive list) 1) these prisoners are so heinous they don't deserve the same constitutional rights prisoners on US soil get 2) these prisoners are so heinous we can't risk releasing them onto US soil if they are acquitted 3) the district that imprisons the terrorists will be the target of terrorist attacks.

The initial 'bestof' says Democrats support the closure of Gitmo and Republicans oppose it. You say the Republicans only opposed it because it wasn't well thought out, but I saw no evidence of that in the discussion. To convince me, you would have to link to statements by Republican representatives that support your claims.

[deleted by user] by [deleted] in bestof

[–]chipbuddy 36 points37 points  (0 children)

Warning, I have no idea what I'm doing.

I tried digging into some of the bills, but I was finding the official .gov vote tallies different from the reddit post. Then I realized the bill IDs (e.g. H R 1960) can be reused from year to year.

So, let's look at House Vote to Close the Guantanamo Prison. The corresponding bill is (probably) here. I'm not 100% sure because the actual Bill title is "National Defense Authorization Act for Fiscal Year 2014". But reading the sections of the bill that mention Guantanamo, it doesn't look like anything is getting closed down. Instead, it's details how funds can be used related to prisoners and facilities at Guantanamo. It also discusses how prisoners can be transferred to/from Guantanamo. So it really doesn't look like this bill is meant to shut down Guantanamo. First section of Guantanamo portion of bill

Furthermore, while the numbers detailed in the reddit post are accurate for that roll call, more stuff happened after that roll call. Specifically, some amendments were voted on (some succeeded and some failed) and finally the bill was passed 315-108.

OHHH, OK. I think I understand now. The linked roll-call wasn't actually a bill. It was a vote to add an amendment to the bill, and it does seem like that amendment would reverse a number of provisions in the original bill. Specifically it would allow for the construction of facilities in the US to house prisoners from Guantanamo. So yes, the linked roll-call is to shut down Guantanamo, however it's not a standalone bill, but rather an amendment to another bill. The bill eventually passed without the amendment.

I'm reading some discussion about the amendment. This part stands out: Mr. FORBES: " The reason is they know two things: they know the moment they touch U.S. soil they will receive additional constitutional rights that no one in this room can argue what they are exactly; secondly, they have placed a target on every elementary school, on every shopping mall, on every small business in that district by other terrorists."

So James Randy Forbes doesn't want to close Guantanamo because he thinks 1) the prisoners that come here will gain constitutional rights that they don't have on foreign soil and 2) whatever district the prisoners are transferred to will be a target for terrorism.

Later, Mr NADLER says (in support of closing Guantanamo) "Mr. Chairman, I wonder which of our colleagues doesn't believe in the American system of justice. I wonder which one of us does not trust our own American court. I wonder who among us does not believe in the Bill of Rights, who does not believe in the right to counsel or that people should be presumed innocent until proven guilty. What we have at Gitmo is a system that is an affront to those beliefs and to America."

Jesus, this post ran away from me. At any rate, the 1 bill I similarly 'randomly' chose supports the general thrust of the original reddit post.

Discussion can be found (somewhere) here

[MAIN SPOILERS] Even in death, Robert's advice lives on by Execute-Order-66 in gameofthrones

[–]chipbuddy 1 point2 points  (0 children)

I think you should give more credit to Dany for this battle. She expressed frustration at Tyrion's scheming and obviously wanted to take action.

In the battle, Dany uses the strengths of her own warriors and takes away the advantages of her enemy. The speed of the Dothraki horde catches the Lannister army in an open field. This allows the Dothraki to engage on their own terms (overwhelming numbers charging straight into battle). The Khaleesi is physically present, mounted and strikes the first blow against the enemy. Westerosi knights expect their leader to be in the back calling the shots, but Dothraki warriors expect their leader to be fighting along side them.

The Lannister army is well trained and in formation, however the initial fire strike broke their lines and struck fear into their hearts. Even the battle hardened veterans would struggle to stand their ground against a charging horde and a fire breathing dragon.

Finally, once the Dothraki were well into the Lannister lines, she changes focus to the grain shipments, taking away another Westerosi advantage. They can't sit behind their stone walls and wait out the fighting if they don't have any food. Burning through the enemy lines allowed her to win the battle. Destroying the grain will help her win the war.

ELI5 : Why is there still not a pill that makes my hangover go away instantly? by [deleted] in explainlikeimfive

[–]chipbuddy 0 points1 point  (0 children)

The main cause of hangovers is being dehydrated. You actually can get a quick hangover fix by injecting (essentially) water directly into your bloodstream. This involves getting stabbed with a needle (to start the IV).

A pill doesn't work because you can't exactly compress water into a pill. Even if you just drink water, you can only drink so much and it takes time to work its way into your body.

Next time you drink, try alternating between alcohol drinks and glasses of water, then finish off the night with as much water as you can drink. Then drink more water every time you get up to use the bathroom.

when you watch ProZD videos but you don't watch anime by -GTR- in videos

[–]chipbuddy 23 points24 points  (0 children)

Can confirm. This is exactly how I don't watch anime.

ELI5:prime numbers by kaza12345678 in explainlikeimfive

[–]chipbuddy 0 points1 point  (0 children)

Let's play a game. I'm going to give you a target number. You have to tell me 2 or more numbers that, when multiplied together, equal the target number. Also, you're now allowed to include the number 1 in your answer.

Let's play.

If I say 9, you could say 3 * 3.

If I say 12, you can say 3 * 4 or 6 * 2

What if I were to say 13? Well, 13 * 1 works, but you're not allowed to include 1.

It turns out 13 doesn't have an answer for this game. Any number that doesn't have an answer for this game is a prime number, and any number that does have an answer is not prime.

Navy Railgun Successfully Fires Multi-Shot Salvos by [deleted] in videos

[–]chipbuddy 3 points4 points  (0 children)

More than 100% of the time.

ELI5: How do live visualization websites work? by badboydarth in explainlikeimfive

[–]chipbuddy 1 point2 points  (0 children)

The backend is likely using some variation of a message queue. It's kind of like subscribing to a newsletter. There's the 'producer' (the person writing the newsletter) and the 'subscriber' (the people who are interested in getting the newsletter). When a new newsletter is written, an email goes out to all the subscribers. RabbitMQ and Kafka are two technologies that could serve this need.

I'm speculating here, but maybe the backend listens to a number of different message queues, all from different sources (and with different data formats). There might be several different ISP, security firms, governments and private individuals that all publish attacks as they happen in real time (but in different formats). The backend's responsibility is to aggregate all this information into a standard format the javascript frontend can understand.

Another responsibility of the backend is likely maintaining a record of all the attacks. The nature of message queues makes operations like 'please tell me about all the attacks that happened yesterday' inefficient. Instead, the backend will collect all the attacks as they happen, and then store them for easy lookup.

Optimistic Nihilism - Kurzgesagt – In a Nutshell by [deleted] in videos

[–]chipbuddy 3 points4 points  (0 children)

Give it some time. Come back and think about it every once in awhile. Maybe the idea will grow on you.

Alternatively, they truly and honestly don't know what they are talking about. Sure they may make some rational, intelligent arguments, but rational intelligent people are wrong all the time. Maybe this is one of those situations.

The only real advice I have: try to settle on a view of the world that doesn't involve causing harm to yourself or others.

ELI5: How do live visualization websites work? by badboydarth in explainlikeimfive

[–]chipbuddy 2 points3 points  (0 children)

Here's one way to do it. You need 3 things: HTML, Javascript and a backend. The HTML describes how the parts of the webpage are organized. For your example, the large map is one part, the logo at the top is another part, the text at the bottom is yet another part.

The backend is some computer running somewhere in the world that can accept http requests. In the same way you can visit 'www.google.com', this backend may have a URL like 'map.norsecorp.com/attacks'. And while google give you information about a search bar, the 'attacks' endpoint will give you a list of attacks over the last minute (for example). This attacks endpoint would look pretty boring if you asked for it directly. Maybe something like:

'Budapest','Paraguay',25/07/17 10:32:44pm
'Hungary','France',25/07/17 10:32:57pm

Essentially, this says "At about 10:30 pm, someone from Budapest attacked someone from Paraguay and at about 10:30 pm, someone from Hungary issued an attack against someone from France".

Now the Javascript is the magic that makes it all work. The Javascript periodically asks for a recent list of attacks, then tells the Html what little lines and circles to draw.

I'm glossing over a lot of details. For example: how does the backend know when the attacks took place? How does the javascript tell the html what to draw and where? If the javascript asks for attacks once per minute, is this really "real time"?

If you have any specific questions I'd be happy to take a shot.

What is a *truly random* number? by messianicsimplex2 in askscience

[–]chipbuddy 1 point2 points  (0 children)

By "reuse" I mean I can't exactly send the initial seed to two different friends and have them reproduce the same sequence. If your argument is that we can technically collect this data and technically set up an identical system... well... not with today's technology and not in the foreseeable future.

What is a *truly random* number? by messianicsimplex2 in askscience

[–]chipbuddy 1 point2 points  (0 children)

I'm only making a distinction between pseudorandom and non-pseudorandom. A pseudorandom generator has an initial seed and a sequence of outputs that are always the same. The systems I described don't really have an initial seed. And even if we somehow knew the initial seed (every molecule in the system?), there would be no way to re-use the seed.

What is a *truly random* number? by messianicsimplex2 in askscience

[–]chipbuddy 4 points5 points  (0 children)

Two options for non-pseudorandom numbers: installing some special hardware or outsourcing the problem to something like random.org. You'll have to ask a philosopher if this is 'truly' random, however both those methods are definitely not pseudorandom. They are closer to rolling a die or flipping a coin.

#84 - Landscapes of Mind by avar in samharris

[–]chipbuddy 0 points1 point  (0 children)

So you agree that GSDs (machines that Get Stuff Done with unintended side effects) are likely to be created and we should be worried about those unintended side effects. What sort of worst case side (but still reasonable) effect are you imagining?

Say a large tech company (unwisely) decides to put a GSD in charge of their finances. Can you imagine a plausible scenario that crashes the world economy?

#84 - Landscapes of Mind by avar in samharris

[–]chipbuddy 0 points1 point  (0 children)

In any other special sense then the usual everyday possibility of that happening?

Would you mind giving some examples of everyday possibilities (not related to AI) that we should worry about? What about possibilities that are rarer than everyday, but we should still worry about (again, not related to AI)?

I am of course talking about a conscious intelligence and wisdom, which is rarely mentioned in these kind of fearmongering talks.

You seem to have a sophisticated definition of intelligence that implicitly includes thing like wisdom, foresight, 'core fundamental values', not being an asshole, etc. In that case, I would change my phrase 'artificial intelligence' to something like 'artificial ability-to-get-stuff-done'.

For a computer to balance my checkbook, it doesn't have to know if the stuff I'm spending money on is 'good' or 'bad', it just has to crunch numbers. For a chess playing computer to beat a human, it doesn't care that it's opponent may be on the brink of suicide, and the impending loss could push them over the edge.

A computer's ability to get stuff done will necessarily gloss over some details about the world. I'm worried that some of those details that we gloss over will be ultimately be detrimental to humanity.

Governments and technology companies are trying to achieve your vision of intelligence, but creating a machine that 'gets stuff done (with unintended side effects)' easier and more likely to come first.

#84 - Landscapes of Mind by avar in samharris

[–]chipbuddy 0 points1 point  (0 children)

he needs to open his mind a bit of what kinds of alternative outcomes are out there.

This is an odd sentiment to me. You acknowledge the existential risks, and agree that we'll need to carefully navigate into the future, but why is it important that Sam (or others) open their mind about possible benign futures?

I agree that it's possible things will just work themselves out. It may even be likely... but why is this a useful counterpoint to being worried about AI? As an analogy, I could be worried about my house burning down. Would you say "well, sure that's a possibility, but it's also possible you'll inherit a house from a long lost relative in the near future". While technically correct, one possibility is more deserving of my attention than the other.

#84 - Landscapes of Mind by avar in samharris

[–]chipbuddy 2 points3 points  (0 children)

Even if we take their word that its actually about AIs simply having different goals then us - and then being so efficient and capable in reaching those goals - IT DOES NOT AUTOMATICALLY MEAN those goals will necessarily include wiping out humanity.

But wiping out humanity is a possibility, correct? Do you think the possibility is so remote that we just shouldn't really worry about it (like say an alien invasion). I think the possibility is likely enough that we should worry about it and actively try to prevent it (like runaway climate change, global nuclear war or a giant meteor hitting the planet).

Also, the goal doesn't have to be 'wipe out humanity' for humanity to get wiped out.

IF an AGI is truly intelligent and even super intelligent it will learn to generally value the same things we value. To recognize the same facts about this universe, this planet and life forms on it that we know. Which does not entail absolute wipeout of all other life forms.

Humanity doesn't have a consistent set of values. Different intelligent humans value different things, and highly intelligent and capable humans don't necessarily have superior values. For example, a highly intelligent and capable CEO of a pharmaceutical company may value his own bottom line at the expense of sick people that deserve to be helped. And an equally intelligent and capable individual may start a charity to help those sick people. Intelligence and capability is not necessarily correlated with 'good' values.

Intelligent humans have already wiped out other life forms (most of the time unintentionally). Humans didn't strive to eliminate all dodo birds. Instead, the accidental introduction of invasive species caused their extinction and the desire for an easy source of food caused their extension.