Giter Club home page Giter Club logo

Comments (6)

fspin avatar fspin commented on May 21, 2024 4

Alright... looking at your code i realize you want me to do grid-template-rows: 50px 0 0 0 1fr, but I never knew this was possible.

Anyway, i still think my solution may be considered valid. And a little explanation about the zeroes here, would be quite interessting. ;)

As i said before, very nice job here.

from gridgarden.

jgierer12 avatar jgierer12 commented on May 21, 2024 2

You didn't solve the challenge correctly: 4 * 10px = 40px but the challenge requires 50px of space above the carrots. I solved it with

grid-template-rows: repeat(4, calc(50px / 4)) 1fr;

which worked just fine.

from gridgarden.

fspin avatar fspin commented on May 21, 2024 2

@Dean-Coakley As you can see, this is not the right answer. But I can explain, of course, what I thought I was doing:

The exercise ask "to water all but the top 50 pixels of your garden". But you also see in the code that the water will only fill the fifth row: grid-row: 5 / 6; this translates to grid-row: grid-column-start / grid-column-end > more on MDN.

So, I have to water the fifth row, and i also have to let 50px without water.

In my solution the first row == 50px, the second, third and fourth row are 0px (or just 0) which means the rows exist, but they are 0 pixel height, and lastly, the fifth will take all the available space to fill with water, so == 1fr.

Or, in a more visual way:

Row 1 = 50px
Row 2 = 0
Row 3 = 0
Row 4 = 0
Row 5 = 1fr

But, as you also can see, this is a little hacky. What i wanted to do was what @jgierer12 pointed out. And, I assume you understand what he said.

I hope this clarify my hacky-solution. :)

from gridgarden.

fspin avatar fspin commented on May 21, 2024

my mistake! :) you're totally right... thanks for pointing it out!

from gridgarden.

Dean-Coakley avatar Dean-Coakley commented on May 21, 2024

@fspin Can you explain grid-template-rows: 50px 0 0 0 1fr for me please?

from gridgarden.

ntrrgc avatar ntrrgc commented on May 21, 2024

I did the same as @fspin and wondered why it did not work: after all, it complied with the problem statement (all but top 50px were watered) and it was never explained that zero-tall rows were valid in general or allowed in the challenges.

Ideally the player should be able to figure out the solution without searching in GitHub issues.

from gridgarden.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.