Solving Magic Square using Functional Programming -- HaskellRank Ep.12

Поділитися
Вставка

КОМЕНТАРІ •

  • @davidyanceyjr
    @davidyanceyjr 6 років тому +32

    This kind of problem - in my opinion - is where Haskell really shines. While I am a beginner, these sorts of problems usually result in those ahh..ha. moments because they're complexity allows for more practical examples of haskells' strengths as opposed to the simple contrived examples found in most texts. Great Video.
    PS....loving your Twitch Streams.

    • @maximusdeshawn4409
      @maximusdeshawn4409 3 роки тому

      I guess I'm kind of off topic but does anyone know of a good website to watch new series online ?

    • @maximusdeshawn4409
      @maximusdeshawn4409 3 роки тому

      @Draven Zachariah thank you, I signed up and it seems like a nice service =) I appreciate it !!

    • @dravenzachariah8454
      @dravenzachariah8454 3 роки тому

      @Maximus Deshawn No problem xD

  • @sho3bum
    @sho3bum 6 років тому +20

    please can we get the magic square full version, I would love to see haskell in full action

  • @davidprock904
    @davidprock904 4 роки тому +8

    How long did it take you to get good like this?

  •  4 роки тому +3

    Man, I really love this kinds of videos. You should upload more videos from hackerrank

  • @mikeg9b
    @mikeg9b 6 років тому +5

    There are only 9! = 362,880 permutations of the numbers [1..9]. I just looped through all of them in Python in less than a second (using the permutations function from the itertools module). Writing a permutations function in Haskell would be a nice exercise.

    • @sho3bum
      @sho3bum 6 років тому +11

      import Data.List
      permutations [1,2,3,4]

  • @valigotech
    @valigotech 6 років тому +2

    That sneaky wiggle at the end!

  • @EidosGaming
    @EidosGaming 4 роки тому +2

    8:46 real haskell programmer speaking sweden

  • @alexanderskusnov5119
    @alexanderskusnov5119 3 роки тому

    unlines adds
    to the last line, so you can use putStr instead of putStrLn in function pp.

  • @philipthomas3503
    @philipthomas3503 5 років тому +1

    How would you solve this if you didn't know what a pre-existing configuration for an n x n matrix looked like?

  • @theJamieBenShaw
    @theJamieBenShaw 3 роки тому

    What colorscheme is this?

  • @olivertirreg
    @olivertirreg 4 роки тому +2

    why not this one?
    allMagic = [id,refl] take 4 (iterate rot90 magic)

    • @jbrains
      @jbrains 3 роки тому

      I think that's the first time I've ever seen where I have _immediately_ understood it. There is hope for us all.

    • @jbrains
      @jbrains 3 роки тому

      I think that's the first time I've ever seen where I have _immediately_ understood it. There is hope for us all.

    • @michael1
      @michael1 2 роки тому +1

      @@jbrains you can say that again

    • @michael1
      @michael1 2 роки тому +1

      @@jbrains I didn't mean that literally

    • @jbrains
      @jbrains 2 роки тому +3

      @@michael1 Stupid UA-cam on Android. :P

  • @DanDart
    @DanDart 5 років тому

    Yeahh! Numberphile rocks!

  • @fimmind
    @fimmind 5 років тому +1

    You can write prettyPrinter prettier using mapM_:
    pp = mapM_ $ print . unwords . map show

  • @therenaissance8322
    @therenaissance8322 5 років тому

    Hi this is fresh toadwalker

  • @nerkulec
    @nerkulec 4 роки тому

    This is soooooooooooo goood

  • @johndowson1852
    @johndowson1852 4 роки тому

    "we could remove pp"

  • @anonymousmokona8541
    @anonymousmokona8541 4 роки тому +2

    the video is 13 minutes and 37 seconds long

  • @FaZekiller-qe3uf
    @FaZekiller-qe3uf 3 місяці тому

    pp magic

  • @polyrtm5545
    @polyrtm5545 4 роки тому

    13:37 lol