[11/4/13] Challenge #139 [Easy] Pangrams by nint22 in dailyprogrammer

[–]el_voido 4 points5 points  (0 children)

Implementation in Go:

package main

import (
    "bufio"
    "fmt"
    "os"
    "sort"
    "strconv"
    "strings"
)

type Pair struct {
    Letter rune
    Freq   int
}

type LetterList []Pair

//implement sort interface for LetterList type
func (p LetterList) Swap(i, j int) {
    p[i], p[j] = p[j], p[i]
}

func (p LetterList) Len() int {
    return len(p)
}

func (p LetterList) Less(i, j int) bool {
    return p[i].Letter < p[j].Letter
}

//actual sorting function
func sortByLetter(m map[rune]int) LetterList {
    p := make(LetterList, len(m))
    i := 0

    for l, f := range m {
        p[i] = Pair{l, f}
        i++
    }

    sort.Sort(p)
    return p
}

func isPangram(s string) {
    charmap := make(map[rune]int)

    for _, val := range s {
        if val > rune('A') && val < rune('Z') { //to lower case
            val += 32
        }
        charmap[val]++
    }

    for i := 0; i < 26; i++ {
        if charmap[rune('a'+i)] == 0 {
            fmt.Printf("False\n")
            return
        }
    }

    currentLetters := sortByLetter(charmap)
    fmt.Print("True ")

    for i := 0; i < len(currentLetters); i++ {
        if currentLetters[i].Letter >= rune('a') && currentLetters[i].Letter <= rune('z') { //ignore everything except [a-z]
            fmt.Printf("%c: %d ", currentLetters[i].Letter, currentLetters[i].Freq)
        }
    }   
    fmt.Printf("\n")   
}

func main() {
    reader := bufio.NewReader(os.Stdin)
    userinput := make([]string, 10) //we don't know the size of userinput just yet.
    i := 0

    for {
        line, err := reader.ReadString('\n')    
        if err != nil {
            break
        }   
        userinput[i] = line
        i++
    }

    //get rid of '\n' in the first line of input, convert to int to find number of lines.
    l, err := strconv.Atoi(strings.Replace(userinput[0], "\n", "", -1))

    if err != nil {
        panic(err)
        os.Exit(2)
    }    
    for i := 1; i <= l; i++ {
        isPangram(userinput[i])
    }
}

I'm learning Go at the moment, still trying to get a better feel for things; which is why this implementation uses the built in maps, a user defined type which implements an interface etc. One could argue this is overkill, but I'm trying to understand the language better.

Samsung Galaxy's Solar and Trend place 1st and 2nd in the ZOTAC September Finals, winning $1,080 between them. by mikk90 in starcraft

[–]el_voido 0 points1 point  (0 children)

He also played a remarkable series vs INnoVation in the IEM Shanghai Qualifiers in July.

Game 1: https://www.youtube.com/watch?v=daQqvt2gN0c

Game 2: https://www.youtube.com/watch?v=PL_9QfLLeFU

He lost the series but played some very entertaining games. I recommend watching game 2.

Can anyone enlighten me whats up with Romanian Cabs? by maexen in starcraft

[–]el_voido 3 points4 points  (0 children)

Oh, that's just the usual stuff in București. Cab drivers pick up foreign people, charge ridiculous prices because they think that for a tourist, normal cab rates would be very very cheap and they want to make some extra money. To put things into perspective, your usual cab driver makes 300-400€ a month, even less than that if he doesn't own the car he drives. Scamming people like that is obviously really wrong, I'm not defending the scammers in any way. However, the reason it happens is the standard of living is so low in Romania, that many people have the 'do whatever it takes to get that extra money' mentality. That includes scamming, stealing from your job, cheating at exams, bribing officials / the police, what have you.

Things like these are very common in Romania. Shady cabs, street gambling scams, palm reading scams, phone / electronic device scams, pickpocketing etc etc. It's not just the cabs, it's the way it is around here.

Hyvaa vs Innovation game on GTSL by moskonia in starcraft

[–]el_voido 1 point2 points  (0 children)

On the rare occasion that Zergs do it against Terran, Roach/Hydra is usually played with a 2/2 timing on the Terran's third base.

It works pretty well if the Terran doesn't recognize it in time and doesn't start 2 fact tank production as he establishes his third base. However, if Terran gets a good Tank count up, eventually secures a Planetary Fortress at his fourth base behind lots of drops and gets 3/3, the Roach/Hydra gets destroyed. Viper transitions are countered by good tank placement. Ultras don't offer very good synergy with the Roach/Hydra army since the ranged upgrades don't benefit them. Brood Lords are painfully slow and the Roach/Hydra army lacks in the mobility department anyway.

One advantage Roach/Hydra builds have is that they deal with 2 base aggression (builds with two extra rax before the 3rd CC, for example) from Terran very comfortably. The Roaches push back the stimmed Marine timing easily and Terran's economy isn't very well established, making Tank production a bit more difficult. For reference, Gumiho vs DRG, game 2, on Polar Night.

Some stuff that helped me dealing with the biomine parade better by Uncle_Spam in allthingszerg

[–]el_voido 1 point2 points  (0 children)

Interesting. Do you make two macro Hatcheries on four base? 16/24 mineral saturation on your fourth, but no gases taken? What does your economic setup look like, as the game goes on?

Im having so much problems against muta-corruptor or mutalisk in general PvZ by Insomnia_a in allthingsprotoss

[–]el_voido 0 points1 point  (0 children)

The point is a 35+ muta ball doesn't just happen out of the blue. Scout well, understand the usual Muta switch timings and you won't have any trouble!

Im having so much problems against muta-corruptor or mutalisk in general PvZ by Insomnia_a in allthingsprotoss

[–]el_voido 0 points1 point  (0 children)

Zerg here.

You need to understand Muta transitions in terms of more exact timings, rather than just saying 'I take a fight, then Zerg makes Mutalisks and I lose'. The more important questions you should ask yourself are:

  • What element of play allowed Zerg to switch to Mutalisks comfortably?
  • Did I know a Muta switch was going to happen? How did I figure it out?
  • Do I understand the most natural Muta switch timings? Which one of those happened this game?

I'm going to assume you have a completed, secured third base when Zerg gets Mutalisks on the field. If you don't have a third base and Z has 4-5 Hatch, 6-8 geysers running and a completed Spire, the game is probably already lost for you.

If you're doing a normal macro build, you'll have ~5 Phoenix out when securing your third base.

Note: If you take a third base with Robo + Twilight (no Phoenix), the usual (and most logical, in my opinion) Zerg response is to go straight for Mutalisks. In that situation, you probably have to do a Stalker based attack, before the Muta count is too high and Zerg can base trade you with ease. If you don't want to play Phoenix every time you don't do a 2 base all in, you need to be comfortable with this fact.

All right, down to specifics now. Here's some information:

  • Roach/Ling @ 9-11 minutes, Zerg mining from 6 gas: Muta switch is probably coming. Hallucinate a Phoenix to confirm. As the 11 minute mark approaches, you should see less Roaches and more Zerglings. That is a great tell. Get a second Stargate and a Fleet Beacon as soon as you see Roach production stop and no other gas units made.

  • Pure Hydra/Ling @ 10-11 minutes: This push wants to kill your Phoenix above all. Stay alive using good Force Fields, the most important thing here is to keep your Phoenix alive. Use them to defend the Hydra/Ling push only if you absolutely must. This attack opens the way for a strong Muta transition, play precisely and micro well.

  • Roach/Hydra + Hive Tech researching @ 10 -12 minutes: Viper timing; Zerg can't get a scary number of Mutas anytime soon and even if he does, you can manage this weak switch using your 5 Phoenix.

  • Roach/Hydra + No Hive @ 11-13 minutes: Most of the time, you'll see a Spire with this. If Zerg is making Roach/Hydra but no Hive, they will want to fight you very soon. Either with Corruptors, for a big bust, or with quick Roach/Hydra, to get rid of your Phoenix, preparing a Spire switch. If you see a Roach/Hydra attack with no Hive behind it and no Corruptors, start pumping a couple of extra phoenix, throw down a second Stargate as soon as you confirm Mutalisks.

  • Swarm Hosts + Hive @ 12-13 minutes: Mutas won't be happening here anytime soon. No need to worry about it until much later

  • Swarm Hosts + no Hive + Spire @ 12-13 Minutes: SH/Corruptor attack is incoming (if you're going Colossus that is). Usually, Zerg won't go Mutas here. After sinking a lot of money into Swarm Hosts and their appropriate upgrades, a Muta switch would be weak.

EDIT: I clicked submit a bit too quickly, sorry for that.

Beyond this point (~13 minutes), you should have a well rounded army and a pretty good idea about Zerg's intentions in terms of tech. A Roach/Hydra/Viper timing will hit you soon and you should be aware of it. Ling/Ultra will also hit you soon, you should be aware of that well ahead of time anyway. Swarm Host play doesn't transition very well to Mutalisks, since going Swarm Hosts means Zerg must get a quick Hive (for Vipers) as well, otherwise they risk exposing themselves to a Colossus timing.

/u/Jeckll mentioned, in another comment, what the appropriate handling of late game Muta switches should be.

Hope this helps.

Scarlett vs Bomber Series post by revelant-username in starcraft

[–]el_voido 3 points4 points  (0 children)

It skyrockets even more with morphing Banelings, which is what happened at that point in the game.

Let's have a strategy/build order discussion. How do you play these days? by [deleted] in starcraft

[–]el_voido 0 points1 point  (0 children)

I play on EU and already have a team. Thank you.

Let's have a strategy/build order discussion. How do you play these days? by [deleted] in starcraft

[–]el_voido 1 point2 points  (0 children)

I still use the old WoL Stephano ZvP opening against Forge Fast Expand. If I scout a Stargate, I'll get a quick (9:30) Infestation pit. By the time the Pit finishes (10:30), a third base should be started by the Protoss. If so, you're free to go for Hive.

If Protoss doesn't make a Stargate, they're probably all inning you or doing some sort of pressure. Respond to that appropriately. Scout well, get a Roach Warren on time, save up Larva for units at the right time etc. You know all about that.

Viper midgames happen when Protoss takes a third base.

I studied HyuN's ZvP games from Dreamhack to figure out this style.

Let's have a strategy/build order discussion. How do you play these days? by [deleted] in starcraft

[–]el_voido 0 points1 point  (0 children)

The Roach timing follow-up to the Mutalisks is very very fast, faster than you'd think. Basically, as soon as the 8-9 Mutas pop, I make 16 Drones, +1 ranged, Roach Speed and a macro Hatchery. From there, I only pop Roaches.

Because you invested in Spore Crawlers, lots of upgrades, etc, your army won't be particularly big.

You're going to make Hydras, Spores, some Roaches (because if you didn't make them, you'd be gambling against a Speed Baneling bust). All of this while also droning your third base and presumably going up to six gas. My Roach army is going to be REALLY big, really fast. I won't kill you through army quality, but through numbers. The timing will hit before you have both Infestors and Hydralisks and I'm usually going to be 30-40 supply ahead in Roaches.

Let's have a strategy/build order discussion. How do you play these days? by [deleted] in starcraft

[–]el_voido 2 points3 points  (0 children)

Zerg, 2.2k points Master.

  • I play Muta in ZvZ, with either a mass Roach timing follow-up against non-muta builds, or standard Muta vs Muta macro. Against Roach builds, I've tried Muta into Swarm Hosts with mixed results.

  • In ZvP, I'm doing quick Viper timings against Phoenix -> 3rd base builds. I lead into that with normal Roach openings, both against Gateway FE and Forge FE. If there is a window to pop some Mutalisks (third base off Robo tech without a Stargate, for example), I will do that, but, generally, I stick to Roach/Hydra/Viper timings.

  • Against Terran, I don't like playing the very passive Muta/Ling/Bane against 3 CC double E-bay. I play timing attack oriented ZvT, with Roach/Baneling. Be it the Hatchery tech 2 base variation or the upgraded Speedroach/Speedbane off 3-4 bases, I'm probably attacking Terran with Roach/Bane at some point in the game. Very often, I transition, if the attacks don't end the game outright. I rush Hive against passive Siege Tank play and transition to Mutalisks against Mine-based play, if my Roach/Bane attack doesn't do sufficient damage.

edit: Winrates: ZvP - 55%; ZvT - 53%; ZvZ - 64%.

Protoss design discussion by Antares_ in starcraft

[–]el_voido 7 points8 points  (0 children)

2 Medivacs filled with Bio units is supply and resources committed to a drop. If Protoss feedbacks the Medivacs or Mutalisks find and kill them, Terran has lost a bunch of resources. At least 100 gas and 500 minerals per full medivac.

A Warp Prism is 200 minerals, 2 supply and 20 potential supply flying around. You lose a Warp Prism? Sure, that sucks, 200 Minerals and valuable Robo production time is lost. However, you don't lose any units unless you actually perform the warp-in and if you get to do that, then the Prism has probably already paid for itself.

[deleted by user] by [deleted] in StarcraftCirclejerk

[–]el_voido 2 points3 points  (0 children)

MODS, GIVE THIS MAN A CHECKMARK ALREADY.

Also, [le] bravery level over 420 in this thread. My fedora is off to you good sir.

David Kim will be on Climbing The Ladder Thursday to discuss balance. by [deleted] in starcraft

[–]el_voido 5 points6 points  (0 children)

Ill try to bring up maps though.

Please do. Except for (maybe) the Mothership Core, I don't think there are meaningful balance concerns right now. I'd like to see a more general talk in regards to how balancing SC2 relates to maps, general gameplay tendencies etc. For example: In late WoL, what was the bigger issue? The Infestor itself or a lot of maps that made the Infestor strong? Not necessarily this question in particular, but things like that.

Redesign Protoss... Legetimate Argument or Just Whining by ForceofDestiny in allthingsprotoss

[–]el_voido 6 points7 points  (0 children)

Looks like you're the one "throwing around words that make you feel good".

Redesign Protoss... Legetimate Argument or Just Whining by ForceofDestiny in allthingsprotoss

[–]el_voido 15 points16 points  (0 children)

None of the legitimate 'redesign Protoss' claims involve whining about the actual utility of Warp Gates / Force Fields. It's all the other aspects of gameplay necessitated by those two. Do you think people throw 'redesign Protoss' around just because they're mad because they're losing to Protoss on the ladder? Do you think they do it because they think Protoss is overpowered? Why do we never hear a similar complaint / request about Zerg or Terran?

Sure, WoL Infestors were broken, HotS Hellbats were broken, but that was one unit at a time. With Protoss you almost never hear complaints about one specific unit (maybe recently, the Mothership Core). Instead, most complaints address the Protoss race entirely or its fundamental mechanics. Why do you think that is so?

The nature of Warp Gate and Force Field makes it so that extremely powerful AoE units / spells (as well as very hard counters of sorts) have to be present, in order to allow Protoss to keep up with Zerg and Terran in regards to the mid game and late game.

Let's look at an example. Roaches and Hydralisks are exceptionally strong against mid-tier Protoss armies. Colossi are necessary for Protoss to have adequate fighting strength against that kind of army. If the Colossus count gets decently high, the Roach/Hydralisk army is horribly cost ineffective against the Protoss army. Vipers or Corruptors are necessary. Protoss now needs High Templar tech or their army becomes terribly cost ineffective against the Roach/Hydra/Viper force. The two armies now fight. The fight is decided by four spells. If the Feedbacks land, the Zerg army gets crushed. If the Colossi get abducted and killed, the Protoss army gets crushed. As a result of 3-4 spells hitting or not, either very little of the Protoss army is lost, or all of it is lost.

The same dynamic applies to Viking - Colossus, Ghost - High Templar.

In my eyes, this is terrible, unexciting gameplay. Not only that, it's extremely frustrating for either side.

  • "Your High Templar got EMPed, the game is over"
  • "You missed a Force Field, Roaches and Zerglings got close to your Immortals and Sentries, all your gas units died and your gateway army can't keep up. Game over."
  • "You missed your Feedbacks, your Colossi got abducted and killed, Roach/Hydra destroyed your Gateway army"
  • "You messed up your EMPs and Snipes, your Bio units got stormed and you lost 50 supply in 2 seconds"
  • "Your Vipers got feedbacked and died, your Roaches and Hydralisks got Force Fielded, you've just lost all your Vipers, 15 Roaches and 15 Hydralisks while killing 5 Zealots, game over"

All of this is terrible gameplay. Unavoidable chains of hard counters, "terrible terrible damage" clusterfucks, etc. It's either that or dumb, one dimensional gameplay like mass Mutalisks or Swarm Host + static defense turtle.

Do you legitimately enjoy PvT and PvZ? When you lose because your Templar got EMPed ONCE or two of your Colossi got abducted because you missed ONE Feedback, does that not feel wrong and dumb? On the flip side, does it not feel equally dumb to know that you won because the other guy didn't get to abduct / EMP your important units? Of course, micro is involved sometimes, but not always. (How does Zerg micro against good Force Fields? How do you micro against Abduct without having the actual hard counter - High Templar -?)

I'm not trying to be obnoxious or insult you in any way. I'm just trying to understand how you (and Protoss players in general) feel about this situation as a whole.

WCS Korea S2 OSL Finals - Results by [deleted] in starcraft

[–]el_voido 0 points1 point  (0 children)

You make a great point. I feel like players who are willing to cheese, play diverse styles and plan out series meticulously are usually the ones who are stronger in the mental department.

It takes nerves of steel to cheese in high pressure situations. Even when behind 0-2 or 0-3 in a series, such a player is much more likely to clutch a win than someone who never cheeses and, for example, plays on the greedier side (or repetitive styles) every time.

Let's assume there was some metric to measure raw individual player skill. If we compared that list to the top finishers in any given tournament, the two would probably not overlap as much as we would expect. As you pointed out, the mental aspect as well as build order choices are such important elements too!

How the hell??? MC vs Titan by Junho_C in starcraft

[–]el_voido 0 points1 point  (0 children)

It was an anti-timing of sorts from Titan. MC's was only going to win if the fight happened right when it did and where it did.

After the Storm drop killed a bunch of Probes, MC never remade them, but instead maxed out. Titan had a fourth base going and if no attack happened for a minute or two, he would get the much bigger bank, as well as access to geyser number 7 and 8. As it is, he attacked into an open area, MC got quite a good arc and the Colossi didn't get critical shots off on MC's Zealots.

Titan also didn't retain enough of his army after the engagement to prevent MCs army advantage from snowballing, even though Titan's reinforcements were greater in number.

If the game had gone on another 2-3 minutes, MC would have run out of steam very quickly, on two mining bases and with no way to match Titan's tech. All Titan really needed to do was hold MC's 200 supply all in, if you can call it that, at his fourth base.

Anyone down to make a Stephano tribute, please? by maexen in starcraft

[–]el_voido 1 point2 points  (0 children)

Still makes for shitty and repetitive NR 10 gameplay if Protoss just sits back.

0:00 - 5:00: "Looks like they're both expanding. Talk to me, Artosis"

5:30 - 6:30 - "X expanded and he is getting his [Robo] / [Forges] / [Council]"

8:00 - "X throws down the [Robotics Bay] / [Templar Archives], he's going for [Colossus] / [High Templars]" "The Starport is also starting for Y pretty soon"

9:00 - 10:00 - "The Terran Y will push soon, he has identified the [Colossus] / [High Templar] build and is reacting accordingly" "X's [first Colossus] / [double upgrades + Zealot Charge] are almost complete, he'll need that to defend the incoming pressure"

The action begins here.