I drew a randomly colored grid of points with tikz, how do I force it to remember the first grid from then on?Rotate a node but not its content: the case of the ellipse decorationTikZ grid and remember picture, overlayTikz and pgf: Grid of Dots with Text and CirclesNumerical conditional within tikz keys?TikZ/ERD: node (=Entity) label on the insideTikZ: Drawing an arc from an intersection to an intersectionHow to show headers on a grid made with TikZ?How to draw grid by given four points in Tikz?grid lines - how to contain within the first quadrantHow to bring points in a tikz grid closer together/remove the space between points in grid in tikz?

How old is Captain America at the end of "Avengers: Endgame"?

Does a member have to be initialized to take its address?

What does i386 mean on macOS Mojave?

Does Lawful Interception of 4G / the proposed 5G provide a back door for hackers as well?

stdout and stderr redirection to different files

"Fīliolō me auctum scito, salva Terentia"; what is "me" role in this phrase?

The lexical root of the past tense forms differs from the lexical root of the infinitive form

Can you book a one-way ticket to the UK on a visa?

Why was the Ancient One so hesitant to teach Dr. Strange the art of sorcery?

As programers say: Strive to be lazy

Would an 8% reduction in drag outweigh the weight addition from this custom CFD-tested winglet?

Is there a need for better software for writers?

Why do unstable nuclei form?

Delta TSA-Precheck status removed

Why do Thanos's punches not kill Captain America or at least cause some mortal injuries?

Why does a C.D.F need to be right-continuous?

What is the best way for a skeleton to impersonate human without using magic?

How can this pool heater gas line be disconnected?

What are some possible reasons that a father's name is missing from a birth certificate - England?

Is a vertical stabiliser needed for straight line flight in a glider?

Is the schwa sound consistent?

How do I tell my supervisor that he is choosing poor replacements for me while I am on maternity leave?

Is it a bad idea to replace pull-up resistors with hard pull-ups?

Should these notes be played as a chord or one after another?



I drew a randomly colored grid of points with tikz, how do I force it to remember the first grid from then on?


Rotate a node but not its content: the case of the ellipse decorationTikZ grid and remember picture, overlayTikz and pgf: Grid of Dots with Text and CirclesNumerical conditional within tikz keys?TikZ/ERD: node (=Entity) label on the insideTikZ: Drawing an arc from an intersection to an intersectionHow to show headers on a grid made with TikZ?How to draw grid by given four points in Tikz?grid lines - how to contain within the first quadrantHow to bring points in a tikz grid closer together/remove the space between points in grid in tikz?













5















I'm using beamer and I have a randomly colored grid (three colors, 4 x 19 grid) on the slides. Since I use the pause command, it generates a new grid every time I click to the next point. How do I force it to remember the first grid it generated? I know it should be something with redefining the color after the first generated grid (maybe edef?).



So this is my code for the grid:



documentclass[a4paper,12pt]beamer
usepackagetikz
usetikzlibrarycalc

pgfmathdeclarerandomlistMyRandomColors%
red%
blue%
green%


begindocument
begintikzpicture[x=0.6cm,y=0.8cm]
foreach x in 0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18
foreach y in 0,1,2,3

pgfmathrandomitemRandomColorMyRandomColors
draw[RandomColor, fill=RandomColor] (x,y) circle (0.2cm);

endtikzpicture
enddocument


enter image description here










share|improve this question




























    5















    I'm using beamer and I have a randomly colored grid (three colors, 4 x 19 grid) on the slides. Since I use the pause command, it generates a new grid every time I click to the next point. How do I force it to remember the first grid it generated? I know it should be something with redefining the color after the first generated grid (maybe edef?).



    So this is my code for the grid:



    documentclass[a4paper,12pt]beamer
    usepackagetikz
    usetikzlibrarycalc

    pgfmathdeclarerandomlistMyRandomColors%
    red%
    blue%
    green%


    begindocument
    begintikzpicture[x=0.6cm,y=0.8cm]
    foreach x in 0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18
    foreach y in 0,1,2,3

    pgfmathrandomitemRandomColorMyRandomColors
    draw[RandomColor, fill=RandomColor] (x,y) circle (0.2cm);

    endtikzpicture
    enddocument


    enter image description here










    share|improve this question


























      5












      5








      5


      0






      I'm using beamer and I have a randomly colored grid (three colors, 4 x 19 grid) on the slides. Since I use the pause command, it generates a new grid every time I click to the next point. How do I force it to remember the first grid it generated? I know it should be something with redefining the color after the first generated grid (maybe edef?).



      So this is my code for the grid:



      documentclass[a4paper,12pt]beamer
      usepackagetikz
      usetikzlibrarycalc

      pgfmathdeclarerandomlistMyRandomColors%
      red%
      blue%
      green%


      begindocument
      begintikzpicture[x=0.6cm,y=0.8cm]
      foreach x in 0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18
      foreach y in 0,1,2,3

      pgfmathrandomitemRandomColorMyRandomColors
      draw[RandomColor, fill=RandomColor] (x,y) circle (0.2cm);

      endtikzpicture
      enddocument


      enter image description here










      share|improve this question
















      I'm using beamer and I have a randomly colored grid (three colors, 4 x 19 grid) on the slides. Since I use the pause command, it generates a new grid every time I click to the next point. How do I force it to remember the first grid it generated? I know it should be something with redefining the color after the first generated grid (maybe edef?).



      So this is my code for the grid:



      documentclass[a4paper,12pt]beamer
      usepackagetikz
      usetikzlibrarycalc

      pgfmathdeclarerandomlistMyRandomColors%
      red%
      blue%
      green%


      begindocument
      begintikzpicture[x=0.6cm,y=0.8cm]
      foreach x in 0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18
      foreach y in 0,1,2,3

      pgfmathrandomitemRandomColorMyRandomColors
      draw[RandomColor, fill=RandomColor] (x,y) circle (0.2cm);

      endtikzpicture
      enddocument


      enter image description here







      tikz-pgf tikz-styles grids






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited May 1 at 12:29









      Sebastiano

      12.1k42467




      12.1k42467










      asked May 1 at 11:56









      pegasuspegasus

      354




      354




















          3 Answers
          3






          active

          oldest

          votes


















          9














          A simple way is to save the grid to a box:



          documentclass[a4paper,12pt]article
          usepackagetikz
          usetikzlibrarycalc

          begindocument

          newboxmygrid
          saveboxmygrid%
          begintikzpicture[x=0.6cm,y=0.8cm]
          foreach x in 0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18
          foreach y in 0,1,2,3

          pgfmathrandomitemRandomColorMyRandomColors
          draw[RandomColor, fill=RandomColor] (x,y) circle (0.2cm);

          endtikzpicture


          %when you want to use the grid, you just call usebox

          useboxmygrid

          enddocument


          You may also place the box within a node for placement control.






          share|improve this answer






























            10














            Specifying a seed pgfmathsetseed1 within your tikzpicture should fix the problem.



            documentclass[10pt,a4paper]beamer
            usepackagetikz
            usetikzlibrarycalc

            pgfmathdeclarerandomlistMyRandomColors%
            red%
            blue%
            green%


            begindocument
            beginframe
            begintikzpicture[x=0.6cm,y=0.8cm]
            pgfmathsetseed1%
            foreach x in 0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18
            foreach y in 0,1,2,3

            pause
            pgfmathrandomitemRandomColorMyRandomColors
            draw[RandomColor, fill=RandomColor] (x,y) circle (0.2cm);

            endtikzpicture
            endframe

            enddocument





            share|improve this answer


















            • 1





              Note that this leads to all random numbers being the same on every slide, which may not be desired.

              – schtandard
              May 1 at 12:52


















            4














            Alternatively to saving the grid in a box, you could compute the random color order only once and use it when creating the grid:



            documentclassarticle

            usepackagetikz
            usetikzlibrarycalc

            usepackageetoolbox

            pgfmathdeclarerandomlistMyRandomColors%
            red%
            blue%
            green%


            makeatletter
            defcolorrows@gobble
            foreach row in 0,...,3
            defcolors@gobble
            foreach col in 0,...,18
            pgfmathrandomitemrandomcolorMyRandomColors
            xapptocolors,randomcolor

            xapptocolorrows,colors

            edefcolorrowscolorrows
            makeatother

            begindocument

            begintikzpicture [x=0.6cm, y=0.8cm]
            foreach row [count=y] in colorrows
            foreach col [count=x] in row
            draw [col, fill=col] (x,y) circle (0.2cm);


            endtikzpicture

            enddocument


            The @gobbles get rid of the first comma added by each loop.






            share|improve this answer























              Your Answer








              StackExchange.ready(function()
              var channelOptions =
              tags: "".split(" "),
              id: "85"
              ;
              initTagRenderer("".split(" "), "".split(" "), channelOptions);

              StackExchange.using("externalEditor", function()
              // Have to fire editor after snippets, if snippets enabled
              if (StackExchange.settings.snippets.snippetsEnabled)
              StackExchange.using("snippets", function()
              createEditor();
              );

              else
              createEditor();

              );

              function createEditor()
              StackExchange.prepareEditor(
              heartbeatType: 'answer',
              autoActivateHeartbeat: false,
              convertImagesToLinks: false,
              noModals: true,
              showLowRepImageUploadWarning: true,
              reputationToPostImages: null,
              bindNavPrevention: true,
              postfix: "",
              imageUploader:
              brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
              contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
              allowUrls: true
              ,
              onDemand: true,
              discardSelector: ".discard-answer"
              ,immediatelyShowMarkdownHelp:true
              );



              );













              draft saved

              draft discarded


















              StackExchange.ready(
              function ()
              StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2ftex.stackexchange.com%2fquestions%2f488570%2fi-drew-a-randomly-colored-grid-of-points-with-tikz-how-do-i-force-it-to-remembe%23new-answer', 'question_page');

              );

              Post as a guest















              Required, but never shown

























              3 Answers
              3






              active

              oldest

              votes








              3 Answers
              3






              active

              oldest

              votes









              active

              oldest

              votes






              active

              oldest

              votes









              9














              A simple way is to save the grid to a box:



              documentclass[a4paper,12pt]article
              usepackagetikz
              usetikzlibrarycalc

              begindocument

              newboxmygrid
              saveboxmygrid%
              begintikzpicture[x=0.6cm,y=0.8cm]
              foreach x in 0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18
              foreach y in 0,1,2,3

              pgfmathrandomitemRandomColorMyRandomColors
              draw[RandomColor, fill=RandomColor] (x,y) circle (0.2cm);

              endtikzpicture


              %when you want to use the grid, you just call usebox

              useboxmygrid

              enddocument


              You may also place the box within a node for placement control.






              share|improve this answer



























                9














                A simple way is to save the grid to a box:



                documentclass[a4paper,12pt]article
                usepackagetikz
                usetikzlibrarycalc

                begindocument

                newboxmygrid
                saveboxmygrid%
                begintikzpicture[x=0.6cm,y=0.8cm]
                foreach x in 0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18
                foreach y in 0,1,2,3

                pgfmathrandomitemRandomColorMyRandomColors
                draw[RandomColor, fill=RandomColor] (x,y) circle (0.2cm);

                endtikzpicture


                %when you want to use the grid, you just call usebox

                useboxmygrid

                enddocument


                You may also place the box within a node for placement control.






                share|improve this answer

























                  9












                  9








                  9







                  A simple way is to save the grid to a box:



                  documentclass[a4paper,12pt]article
                  usepackagetikz
                  usetikzlibrarycalc

                  begindocument

                  newboxmygrid
                  saveboxmygrid%
                  begintikzpicture[x=0.6cm,y=0.8cm]
                  foreach x in 0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18
                  foreach y in 0,1,2,3

                  pgfmathrandomitemRandomColorMyRandomColors
                  draw[RandomColor, fill=RandomColor] (x,y) circle (0.2cm);

                  endtikzpicture


                  %when you want to use the grid, you just call usebox

                  useboxmygrid

                  enddocument


                  You may also place the box within a node for placement control.






                  share|improve this answer













                  A simple way is to save the grid to a box:



                  documentclass[a4paper,12pt]article
                  usepackagetikz
                  usetikzlibrarycalc

                  begindocument

                  newboxmygrid
                  saveboxmygrid%
                  begintikzpicture[x=0.6cm,y=0.8cm]
                  foreach x in 0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18
                  foreach y in 0,1,2,3

                  pgfmathrandomitemRandomColorMyRandomColors
                  draw[RandomColor, fill=RandomColor] (x,y) circle (0.2cm);

                  endtikzpicture


                  %when you want to use the grid, you just call usebox

                  useboxmygrid

                  enddocument


                  You may also place the box within a node for placement control.







                  share|improve this answer












                  share|improve this answer



                  share|improve this answer










                  answered May 1 at 12:13









                  FrédéricFrédéric

                  9,28222941




                  9,28222941





















                      10














                      Specifying a seed pgfmathsetseed1 within your tikzpicture should fix the problem.



                      documentclass[10pt,a4paper]beamer
                      usepackagetikz
                      usetikzlibrarycalc

                      pgfmathdeclarerandomlistMyRandomColors%
                      red%
                      blue%
                      green%


                      begindocument
                      beginframe
                      begintikzpicture[x=0.6cm,y=0.8cm]
                      pgfmathsetseed1%
                      foreach x in 0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18
                      foreach y in 0,1,2,3

                      pause
                      pgfmathrandomitemRandomColorMyRandomColors
                      draw[RandomColor, fill=RandomColor] (x,y) circle (0.2cm);

                      endtikzpicture
                      endframe

                      enddocument





                      share|improve this answer


















                      • 1





                        Note that this leads to all random numbers being the same on every slide, which may not be desired.

                        – schtandard
                        May 1 at 12:52















                      10














                      Specifying a seed pgfmathsetseed1 within your tikzpicture should fix the problem.



                      documentclass[10pt,a4paper]beamer
                      usepackagetikz
                      usetikzlibrarycalc

                      pgfmathdeclarerandomlistMyRandomColors%
                      red%
                      blue%
                      green%


                      begindocument
                      beginframe
                      begintikzpicture[x=0.6cm,y=0.8cm]
                      pgfmathsetseed1%
                      foreach x in 0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18
                      foreach y in 0,1,2,3

                      pause
                      pgfmathrandomitemRandomColorMyRandomColors
                      draw[RandomColor, fill=RandomColor] (x,y) circle (0.2cm);

                      endtikzpicture
                      endframe

                      enddocument





                      share|improve this answer


















                      • 1





                        Note that this leads to all random numbers being the same on every slide, which may not be desired.

                        – schtandard
                        May 1 at 12:52













                      10












                      10








                      10







                      Specifying a seed pgfmathsetseed1 within your tikzpicture should fix the problem.



                      documentclass[10pt,a4paper]beamer
                      usepackagetikz
                      usetikzlibrarycalc

                      pgfmathdeclarerandomlistMyRandomColors%
                      red%
                      blue%
                      green%


                      begindocument
                      beginframe
                      begintikzpicture[x=0.6cm,y=0.8cm]
                      pgfmathsetseed1%
                      foreach x in 0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18
                      foreach y in 0,1,2,3

                      pause
                      pgfmathrandomitemRandomColorMyRandomColors
                      draw[RandomColor, fill=RandomColor] (x,y) circle (0.2cm);

                      endtikzpicture
                      endframe

                      enddocument





                      share|improve this answer













                      Specifying a seed pgfmathsetseed1 within your tikzpicture should fix the problem.



                      documentclass[10pt,a4paper]beamer
                      usepackagetikz
                      usetikzlibrarycalc

                      pgfmathdeclarerandomlistMyRandomColors%
                      red%
                      blue%
                      green%


                      begindocument
                      beginframe
                      begintikzpicture[x=0.6cm,y=0.8cm]
                      pgfmathsetseed1%
                      foreach x in 0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18
                      foreach y in 0,1,2,3

                      pause
                      pgfmathrandomitemRandomColorMyRandomColors
                      draw[RandomColor, fill=RandomColor] (x,y) circle (0.2cm);

                      endtikzpicture
                      endframe

                      enddocument






                      share|improve this answer












                      share|improve this answer



                      share|improve this answer










                      answered May 1 at 12:14









                      user605895user605895

                      3564




                      3564







                      • 1





                        Note that this leads to all random numbers being the same on every slide, which may not be desired.

                        – schtandard
                        May 1 at 12:52












                      • 1





                        Note that this leads to all random numbers being the same on every slide, which may not be desired.

                        – schtandard
                        May 1 at 12:52







                      1




                      1





                      Note that this leads to all random numbers being the same on every slide, which may not be desired.

                      – schtandard
                      May 1 at 12:52





                      Note that this leads to all random numbers being the same on every slide, which may not be desired.

                      – schtandard
                      May 1 at 12:52











                      4














                      Alternatively to saving the grid in a box, you could compute the random color order only once and use it when creating the grid:



                      documentclassarticle

                      usepackagetikz
                      usetikzlibrarycalc

                      usepackageetoolbox

                      pgfmathdeclarerandomlistMyRandomColors%
                      red%
                      blue%
                      green%


                      makeatletter
                      defcolorrows@gobble
                      foreach row in 0,...,3
                      defcolors@gobble
                      foreach col in 0,...,18
                      pgfmathrandomitemrandomcolorMyRandomColors
                      xapptocolors,randomcolor

                      xapptocolorrows,colors

                      edefcolorrowscolorrows
                      makeatother

                      begindocument

                      begintikzpicture [x=0.6cm, y=0.8cm]
                      foreach row [count=y] in colorrows
                      foreach col [count=x] in row
                      draw [col, fill=col] (x,y) circle (0.2cm);


                      endtikzpicture

                      enddocument


                      The @gobbles get rid of the first comma added by each loop.






                      share|improve this answer



























                        4














                        Alternatively to saving the grid in a box, you could compute the random color order only once and use it when creating the grid:



                        documentclassarticle

                        usepackagetikz
                        usetikzlibrarycalc

                        usepackageetoolbox

                        pgfmathdeclarerandomlistMyRandomColors%
                        red%
                        blue%
                        green%


                        makeatletter
                        defcolorrows@gobble
                        foreach row in 0,...,3
                        defcolors@gobble
                        foreach col in 0,...,18
                        pgfmathrandomitemrandomcolorMyRandomColors
                        xapptocolors,randomcolor

                        xapptocolorrows,colors

                        edefcolorrowscolorrows
                        makeatother

                        begindocument

                        begintikzpicture [x=0.6cm, y=0.8cm]
                        foreach row [count=y] in colorrows
                        foreach col [count=x] in row
                        draw [col, fill=col] (x,y) circle (0.2cm);


                        endtikzpicture

                        enddocument


                        The @gobbles get rid of the first comma added by each loop.






                        share|improve this answer

























                          4












                          4








                          4







                          Alternatively to saving the grid in a box, you could compute the random color order only once and use it when creating the grid:



                          documentclassarticle

                          usepackagetikz
                          usetikzlibrarycalc

                          usepackageetoolbox

                          pgfmathdeclarerandomlistMyRandomColors%
                          red%
                          blue%
                          green%


                          makeatletter
                          defcolorrows@gobble
                          foreach row in 0,...,3
                          defcolors@gobble
                          foreach col in 0,...,18
                          pgfmathrandomitemrandomcolorMyRandomColors
                          xapptocolors,randomcolor

                          xapptocolorrows,colors

                          edefcolorrowscolorrows
                          makeatother

                          begindocument

                          begintikzpicture [x=0.6cm, y=0.8cm]
                          foreach row [count=y] in colorrows
                          foreach col [count=x] in row
                          draw [col, fill=col] (x,y) circle (0.2cm);


                          endtikzpicture

                          enddocument


                          The @gobbles get rid of the first comma added by each loop.






                          share|improve this answer













                          Alternatively to saving the grid in a box, you could compute the random color order only once and use it when creating the grid:



                          documentclassarticle

                          usepackagetikz
                          usetikzlibrarycalc

                          usepackageetoolbox

                          pgfmathdeclarerandomlistMyRandomColors%
                          red%
                          blue%
                          green%


                          makeatletter
                          defcolorrows@gobble
                          foreach row in 0,...,3
                          defcolors@gobble
                          foreach col in 0,...,18
                          pgfmathrandomitemrandomcolorMyRandomColors
                          xapptocolors,randomcolor

                          xapptocolorrows,colors

                          edefcolorrowscolorrows
                          makeatother

                          begindocument

                          begintikzpicture [x=0.6cm, y=0.8cm]
                          foreach row [count=y] in colorrows
                          foreach col [count=x] in row
                          draw [col, fill=col] (x,y) circle (0.2cm);


                          endtikzpicture

                          enddocument


                          The @gobbles get rid of the first comma added by each loop.







                          share|improve this answer












                          share|improve this answer



                          share|improve this answer










                          answered May 1 at 12:49









                          schtandardschtandard

                          2,5771121




                          2,5771121



























                              draft saved

                              draft discarded
















































                              Thanks for contributing an answer to TeX - LaTeX Stack Exchange!


                              • Please be sure to answer the question. Provide details and share your research!

                              But avoid


                              • Asking for help, clarification, or responding to other answers.

                              • Making statements based on opinion; back them up with references or personal experience.

                              To learn more, see our tips on writing great answers.




                              draft saved


                              draft discarded














                              StackExchange.ready(
                              function ()
                              StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2ftex.stackexchange.com%2fquestions%2f488570%2fi-drew-a-randomly-colored-grid-of-points-with-tikz-how-do-i-force-it-to-remembe%23new-answer', 'question_page');

                              );

                              Post as a guest















                              Required, but never shown





















































                              Required, but never shown














                              Required, but never shown












                              Required, but never shown







                              Required, but never shown

































                              Required, but never shown














                              Required, but never shown












                              Required, but never shown







                              Required, but never shown







                              Popular posts from this blog

                              How to write a 12-bar blues melodyI-IV-V blues progressionHow to play the bridges in a standard blues progressionHow does Gdim7 fit in C# minor?question on a certain chord progressionMusicology of Melody12 bar blues, spread rhythm: alternative to 6th chord to avoid finger stretchChord progressions/ Root key/ MelodiesHow to put chords (POP-EDM) under a given lead vocal melody (starting from a good knowledge in music theory)Are there “rules” for improvising with the minor pentatonic scale over 12-bar shuffle?Confusion about blues scale and chords

                              What if the end-user didn't have the required library?What is setup.py?What is a clean, pythonic way to have multiple constructors in Python?What does Ruby have that Python doesn't, and vice versa?What is the reason for having '//' in Python?How do I create a namespace package in Python?How to package shared objects that python modules depend on?setuptools vs. distutils: why is distutils still a thing?Navigation in Windows 10 vs code not going to virtualenv library when the same library is installed at user levelPython create package for local usePackaging a project that uses multiple python versionsWhy is permission denied on pip install except for when “--user” is included at end of command?

                              Why did Thanos need his ship to help him in the battle scene?Which actor plays Thanos in the Avengers mid-credits scene?Are there economic implications portrayed in comics where the buildings and cities are ruined almost daily?Old X-Men comic where team travels to alien world with a ring-like sun that needs recharging?Why does Ego need help sleeping?Is there an objective answer to who “the strongest Avenger” is?How did Banner get unstuck?Why did Thanos get hit?How did Thanos (or anyone) know the Infinity Stones would give him this power?Did Thanos leave Eitri alive for his after-sales service?In Avengers 1, why does Thanos need Loki?