GithubHelp home page GithubHelp logo

Comments (70)

realtebo avatar realtebo commented on May 2, 2024 94

Use grid-template-rows to water all but the top 50 pixels of your garden. Note that the water is set to fill only your 5th row, so you'll need to create 5 rows in total.

  1. You know that you must create 5 rows
  2. you know that rows 1 to 4 must NOT be covered with water
  3. you know that rows 1 to 4 in total are 50 px

so

  1. from point 3 you understand that rows 1, 2, 3, and 4 must height in total px, so every rows must be 12.5px height
  2. the fifth rows must me simple height the rest of available space, that you can set using 1fr

So the problem here is understanding the problem. It taken 30mins for my mind to resolve it. 🥇

from gridgarden.

lyonsun avatar lyonsun commented on May 2, 2024 29

I was also stuck at level 26, @realtebo had a good explanation.

For me, the following answer:

grid-template-rows: repeat(4, 12.5px) 1fr;

is much easier to understand than the shrunk one in the screenshot:

grid-template-rows: repeat(4, 12.5px);

from gridgarden.

robertpenner avatar robertpenner commented on May 2, 2024 28

image
https://twitter.com/miklb/status/850759537665732610

from gridgarden.

esitarz avatar esitarz commented on May 2, 2024 15

I thought this one was goofy as well.
In case it's easier for you to approach from a different perspective, here is what I used to advance:

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

from gridgarden.

Joru-chan avatar Joru-chan commented on May 2, 2024 11

I do agree that the phrasing is odd and I got around to it by doing grid-template-rows: repeat(4, 12.5px). It was tough to "get" that the water was only on the last row and that you needed to make mini rows before that. A simple tip to just look at the rest of the code before proceeding would help because that's when it clicked for me (when i saw the #water {
grid-column: 1 / 6;
grid-row: 5 / 6;
})

from gridgarden.

robertpenner avatar robertpenner commented on May 2, 2024 8

Oh, other people struggling with level 26 ended up making zero-height rows, which wasn't a concept previously introduced:
#23

from gridgarden.

jogavidia avatar jogavidia commented on May 2, 2024 7

It's not clear

from gridgarden.

robdll avatar robdll commented on May 2, 2024 7

same here. Went flowless to levele 26 and got stuck for half an hour.

from gridgarden.

m-nathani avatar m-nathani commented on May 2, 2024 5
grid-template-rows: 50px 1fr 1fr 1fr 100%;

This solution worked for us.. however, it stopped me for moving forward, since the button was disabled..

So to enable it, open dev tools, inspect the button and remove disabled attribute and move forward. 😂

from gridgarden.

josecalvano1546 avatar josecalvano1546 commented on May 2, 2024 3

Considero que en este momento se hace referencia a lo que se conoce en css grid como "implicit grid " and "Explicit Grid".
Reference:
https://www.quackit.com/css/grid/tutorial/explicit_vs_implicit_grid.cfm
img:
Captura de Pantalla 2020-01-15 a la(s) 15 12 33

from gridgarden.

youarebju avatar youarebju commented on May 2, 2024 3

grid-template-rows: 50px 0 0 0 1fr; or
grid-template-rows: 0 0 0 50px 1fr;
looks good~
image

from gridgarden.

bakerlisa avatar bakerlisa commented on May 2, 2024 3

Thank you for this. I did not get what they were asking me to do.

from gridgarden.

robertpenner avatar robertpenner commented on May 2, 2024 2

Some people stumped by the math in level 26:
#66

from gridgarden.

Linxeyes avatar Linxeyes commented on May 2, 2024 2

Finger in the nose for all exercises, but where i was at level 26, ...!

Stuck about 1hour, i also looked the code source if there is the code anywhere, and watched videos about grid-template-rows for nothing ^^'.
And i found here some results ... But i'm very frustred because i don't really understood the thing ._. i watched some video, that was simple in that, but not with exercise of grid garden ><.

In fact, i tried to make only 2rows with the first to 50px and second row lef-over, but i think it wasn't possible with
#water {
grid-column: 1 / 6;
grid-row: 5 / 6;
}
and i don't find an other way... Maybe the sequence was not enough clear for the work to do..?

So i wasn't alone to be stuck, i'm salve ^^.

from gridgarden.

razvanstroici avatar razvanstroici commented on May 2, 2024 2

My simple answer was this:
grid-template-rows: 12.5px 12.5px 12.5px 12.5px 1fr;

What can easily turn into this:
grid-template-rows: repeat(4, 12.5px) 1fr;

I don't think this answer ( grid-template-rows: repeat (4, 12.5px); ) is correct.
Simply because it creates 8 rows and we only need to create 5 rows.
https://prnt.sc/soqu9m

from gridgarden.

hanzlahabib avatar hanzlahabib commented on May 2, 2024 2

After 5 years, it is still a riddle,

from gridgarden.

9nikolov avatar 9nikolov commented on May 2, 2024 2

MOST IMPORTANT SENTENCE IN THE LEVEL:
water is set to fill only your 5th row

It's not the exercise that is hard, its the way the question is formulated. You really have to pay more attention while reading it.

Water all but the top 50 pixels of your garden.
Note that the water is set to fill only your 5th row, so you'll need to create 5 rows in total.

from gridgarden.

wangk29 avatar wangk29 commented on May 2, 2024 1

I thought this one was goofy as well.
In case it's easier for you to approach from a different perspective, here is what I used to advance:

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

Thank you this one made sense for me!

from gridgarden.

grungydan avatar grungydan commented on May 2, 2024 1

Agree, this one is extremely obtuse. I find it a bit to "this is tricky" and not very "this is useful." What possible layout concept does this help to illustrate?

from gridgarden.

anpel avatar anpel commented on May 2, 2024 1

Found this by googling the solution to 26. Maybe a button that shows you the answer after a couple of failed attempts would help.

from gridgarden.

kzsa avatar kzsa commented on May 2, 2024 1

The Hungarian version is a bit trickier :D

"Használd a grid-template-rows kódot, hogy megöntözd a felső 50 pixel magas részt a kertednek."
So in Hungarian we should be watering the upper 50px part.
(level 26)

Anyway ... I like this game!

Thanks to Balázs Tóth for the confirmation!
Br: Zsolt

from gridgarden.

ElijahLynn avatar ElijahLynn commented on May 2, 2024 1

A simple tip to just look at the rest of the code before proceeding would help because that's when it clicked for me (when i saw the #water {
grid-column: 1 / 6;
grid-row: 5 / 6;
})

This is key, I wasn't looking at the rest of the code. Once I look at the code it all makes sense. This tip is key and should be added to the instruction text.

from gridgarden.

nataliecardot avatar nataliecardot commented on May 2, 2024 1

You can figure out how to do it from the provided info if you read it very carefully, but it doesn't make intuitive sense to divide up the 50px empty area into a bunch of rows (whereas reasoning of where to split up columns/rows was understandable in the previous levels) - why would an empty area be split up if the goal is to water the area with plants?

from gridgarden.

mcloughman avatar mcloughman commented on May 2, 2024 1

I think the best way to grasp it is to see that your only watering from the 5th row gridline to the 6th row gridline. Your water grid-row is unchangeable.
So you know that somehow you need to make 4 rows that won't be watered...and then water the rest. And you also know that that the total height of the four rows that won't be watered is 50px. I think to really visualize what is happening is to use
grid-row-templates: repeat(4, 12.5px) 1fr
-- even though you'll still get credited if you don't add the 1fr on the end, it helps greatly to have it because it really shows the true new grid-row-template that you created

from gridgarden.

Joakoq12 avatar Joakoq12 commented on May 2, 2024 1

I was so close ! I was stuck in repeat(4, 13px) lmao

from gridgarden.

ceddddy avatar ceddddy commented on May 2, 2024 1

Number 26 convinced me that I'm a bit slow. What a question !!!!

from gridgarden.

juanluischaurant avatar juanluischaurant commented on May 2, 2024 1

image

This is the correct answer, from previous questions we've been hinted that the empty space at the top height is 50px. We're told that water is only on the 5th row.

So, what I did was:

  1. Divide 50px/4.
  2. then repeat(4, 12.5px), which will distribute the 50px between 4 rows for marking the 50px empty space
  3. take the remaining space with 1fr

from gridgarden.

nadieenespecial avatar nadieenespecial commented on May 2, 2024

I didnt get it :/

from gridgarden.

lekmao avatar lekmao commented on May 2, 2024

@lyonsun Your last answer grid-template-rows: repeat(4, 12.5px); is the best so far. Makes a lot of sense now seeing it work! Thanks!

from gridgarden.

jothamardel avatar jothamardel commented on May 2, 2024

I don't understand after spending hours trying to find a solution, I came up with this:
grid-template-rows: repeat(2, 0%)25px 25px;

from gridgarden.

Lacruzf avatar Lacruzf commented on May 2, 2024

grid-template-rows: repeat(4,12.5px) 1fr;
image

from gridgarden.

MDutro avatar MDutro commented on May 2, 2024

I have really enjoyed this tutorial and Flex Froggy too. Thank you for creating it!

I would echo others in this thread and say that I had some trouble with this question too. Also the app does not accept my initial solution:

grid-template-rows: 50px 1px 1px 1px 1fr;

Visually, this appears to solve the problem, i.e. all carrots are watered. Granted some of the other rows are essentially invisible but that did not appear to be a constraint at first.

Also, the wording lead me to believe that the first row was required to be 50px itself, hence me making 3 tiny ones.

I hope this criticism is taken in the constructive light in which it is meant. Thank you again for creating a fun way to learn some tricky CSS concepts for a beginner like me!

from gridgarden.

AurionVII avatar AurionVII commented on May 2, 2024

I have really enjoyed this tutorial and Flex Froggy too. Thank you for creating it!

I would echo others in this thread and say that I had some trouble with this question too. Also the app does not accept my initial solution:

grid-template-rows: 50px 1px 1px 1px 1fr;

I've found why your solution doesn't work when you try it. You had three lines of 1px so its become 3px. You just need to remove three to fifty for it to work. ;)
Here's your solution without the issue:

grid-template-rows: 47px 1px 1px 1px; or grid-template-rows: 47px 1px 1px 1px 1fr;

from gridgarden.

gulzaryousaf avatar gulzaryousaf commented on May 2, 2024

I thought this one was goofy as well.
In case it's easier for you to approach from a different perspective, here is what I used to advance:

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

I would like to stick with this solution because he said in the note that the water is set to fill only your 5th row, so you'll need to create 5 rows in total.

This one is also good grid-template-rows: repeat(4,12.5px) 1fr;

from gridgarden.

0Phenix0 avatar 0Phenix0 commented on May 2, 2024

I have really enjoyed this tutorial and Flex Froggy too. Thank you for creating it!

I would echo others in this thread and say that I had some trouble with this question too. Also the app does not accept my initial solution:

grid-template-rows: 50px 1px 1px 1px 1fr;

Visually, this appears to solve the problem, i.e. all carrots are watered. Granted some of the other rows are essentially invisible but that did not appear to be a constraint at first.

Also, the wording lead me to believe that the first row was required to be 50px itself, hence me making 3 tiny ones.

I hope this criticism is taken in the constructive light in which it is meant. Thank you again for creating a fun way to learn some tricky CSS concepts for a beginner like

This solution may be visually correct, but 50+1+1+1 gives 53px, and it's more than the 50px they asked for; you could try 47 1 1 1 to add up to 50 but yet, the solutions above your comment are the best.
ps: Don't change the exercise, it helped us understand more about CSS grid, I'm sure that the 25 exercises before this one were so easy and straightforward, hens, we will not really recall the solutions when designing a layout.
keep up guys I really appreciate what you are doing, thanks!

from gridgarden.

cbunch289 avatar cbunch289 commented on May 2, 2024

I ended up only creating four rows and it accepted the answer as valid. Obviously this part of the exercise demands attention.

from gridgarden.

PremanandChowdhury avatar PremanandChowdhury commented on May 2, 2024

After learning different solutions, i figured the main purpose of this problem.

Now, the question:

It says to water all, except the 50px of the garden from the top.
Also the no. of rows should be 5.

Meaning :

The last row should span excluding 50px from the start of the garden, to the end of the garden.
The top 50px will become the 4 rows with size ( 50px / 4 = 12.5px each).

code :

grid-template-rows: repeat(4, 12.5px) 1fr;

Explanation:

repeat(4, 12.5px) : creates the 4 rows inside the top 50px area.
1fr : spans the last row to the end.

from gridgarden.

JuandaGarcia avatar JuandaGarcia commented on May 2, 2024

image

Bug 😁

from gridgarden.

katsuya245126 avatar katsuya245126 commented on May 2, 2024

image

Bug

@JuandaGarcia
Your first 4 rows only add up to 40px whereas it's supposed to add up to 50.

This problem was poorly worded tbh. Once I understood what I was actually supposed to do, it was pretty easy

from gridgarden.

gersonmontenegro avatar gersonmontenegro commented on May 2, 2024

I don't really get why if I separated the spaces, the water doesn't reach the space
image

from gridgarden.

katsuya245126 avatar katsuya245126 commented on May 2, 2024

I don't really get why if I separated the spaces, the water doesn't reach the space
image

Check the bottom code for #water. It says to water column lines 1-6 and row lines 5-6. But your code has only three row lines like so:

|--50px--|------------------1 fr--------------------|
1--------2-----------------------------------------3

from gridgarden.

neahpanilag avatar neahpanilag commented on May 2, 2024

it's rather odd i easily solved 27 through 28 but not 26. thought i was the only one having difficulty with the phrasing of the instruction.

from gridgarden.

famingyuan avatar famingyuan commented on May 2, 2024
  1. water all but the top 50 pixels
  2. 5 rows in total
  3. water is set to fill only your 5th row.

I can't make it before i see the answer. I am stupid.

grid-template-rows:repeat(4, 12.5px) 1fr;

from gridgarden.

Myline1991 avatar Myline1991 commented on May 2, 2024

I find myself stuck at this level, I have finally found a solution who appears to work but not accepted :(

grid26

from gridgarden.

kzsa avatar kzsa commented on May 2, 2024

:D a cool representation of the grid system! I also showed it to my kids. They love it too, thank you very much! I teach them mathematics, physics, electrical engineering in a similar approach, I think everything should be taught this way.

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

It took me a while too, because the Hungarian translation is wrong. According to that, the top 50 pixels should be watered, but that makes no sense because of the beets. :D

"Használd a grid-template-rows kódot, hogy megöntözd a felső 50 pixel magas részt a kertednek."

means:

"Use the grid-template-rows code to water the top 50 pixels high part of your garden." :D

from gridgarden.

thomaspark avatar thomaspark commented on May 2, 2024

Hey @kzsa, thanks for sharing your thoughts.

@pehsa, are you available to take another pass at the Hungarian translation?

from gridgarden.

kzsa avatar kzsa commented on May 2, 2024

from gridgarden.

thomaspark avatar thomaspark commented on May 2, 2024

Hey Zsolt, that sounds good, any help on the translation is appreciated!

from gridgarden.

BlasToth avatar BlasToth commented on May 2, 2024

The Hungarian version is a bit trickier :D

"Használd a grid-template-rows kódot, hogy megöntözd a felső 50 pixel magas részt a kertednek."
So in Hungarian we should be watering the upper 50px part.
(level 26)

Anyway ... I like this game!

from gridgarden.

AhmadDalao avatar AhmadDalao commented on May 2, 2024

my solution was :
grid-template-rows: auto auto auto 50px 1fr;
and it worked for me.

Screenshot_3

from gridgarden.

agraham75 avatar agraham75 commented on May 2, 2024

Can someone explain why this solution worked?
image

from gridgarden.

zhangjun620 avatar zhangjun620 commented on May 2, 2024

my answer is : 50px repeat(3,0);
but i dont know why (3,0) is valid

from gridgarden.

aliihsansenel avatar aliihsansenel commented on May 2, 2024

grid-template-rows: repeat(4, calc(50px/4)) 1fr; also works but
grid-template-rows: 50px auto auto auto 1fr; and grid-template-rows: 50px 0 0 0 1fr; seem more sophisticated.

from gridgarden.

mnbroatch avatar mnbroatch commented on May 2, 2024

I agree that this level is too clever. It made me think, "Oh, I didn't realize it was that kind of puzzle game", in a bad way.

from gridgarden.

ArnasLuksas avatar ArnasLuksas commented on May 2, 2024

Got the answer from here, but still i don't understand..

from gridgarden.

kzsa avatar kzsa commented on May 2, 2024

Got the answer from here, but still i don't understand..

Hi Arnas,
To understand how it really works, I suggest you review the following resources:

Rachel Andrew - https://rachelandrew.co.uk/
https://gridbyexample.com/

Jen Simmons - https://www.youtube.com/channel/UC7TizprGknbDalbHplROtag

Una Kravets - https://1linelayouts.glitch.me/

Br: Zsolt

from gridgarden.

Freddymhs avatar Freddymhs commented on May 2, 2024

working with : 50px 0 0 0;

from gridgarden.

yonhung avatar yonhung commented on May 2, 2024

grid-template-rows: 50px 0 0 0 1fr; and grid-template-rows: 50px auto auto auto 1fr; are easier to understand.
0 0 0means that there are three rows, but they all have a height of 0.
auto auto auto means that there are three rows. Their height depends on the content inside.

from gridgarden.

Dmytro2V avatar Dmytro2V commented on May 2, 2024

It's easy to understand few popular solutions, with 0 high rows or with 4 * 12.5px.
It's more or less understandable why 50px - 100% not working (100% overlapping 50 px despite it is not visible).
But what is hard - why we have additional autogreed rows instead of an empty space in 50 px 4 * 0 or 4 * 12,5 (without 1fr at the end) solutions.
Is it a bug, or a normal way?

from gridgarden.

zhefciad avatar zhefciad commented on May 2, 2024

grid-template-rows: 50px repeat(3, 1fr) 3643fr;
is what I came up with. Seems oddly incorrect, but hey it works :D

from gridgarden.

narayan-raghuwanshi avatar narayan-raghuwanshi commented on May 2, 2024

There can be multiple ways to think:

  1. grid-template-rows: 50px 0px 0px 0px 1fr;
  2. grid-template-rows: 0px 50px 0px 0px 1fr;
  3. grid-template-rows: 0px 0px 50px 0px 1fr;
  4. grid-template-rows: 0px 0px 0px 50px 1fr;

from gridgarden.

SCORPSTREAM avatar SCORPSTREAM commented on May 2, 2024

ohh no, I am reading all your solutions, but I came up with so weird solution: 1fr 1fr 1fr 1fr 70fr (((

from gridgarden.

ileadu avatar ileadu commented on May 2, 2024

grid-template-rows : repeat(4, 12.5px);
2023-04-19 21_57_25-Window

grid-template-rows : 50px repeat(3, 0px) 1fr; should be the same.

from gridgarden.

 avatar commented on May 2, 2024

Total newbie in the scene, but i finally understood the [repeat(4, 12.5px) 1fr;] simply by understanding that the water is ON the fifth row while the sixth is the -bottom- like it would be the container border (which is empty).

So to "pull" the water up, we need to "compress" the others 4 behind.

To do so, you know that the "first" line/blank-space is 50px in height.
Then you go and put <1fr 1fr 1fr 1fr 1fr> to check where the last one is the FIFTH row having water "inside".

So we keep this last 1fr and for the others 4 we take them in the formula above that means: repeat 4 times the 1fr for 12.5px since the first line is 50px wide (50 divided by 4 equals 12.5) to compress the 4 rows and so the fifth row is "pulled up" filling all the container.

Sorry for this messy explanation, hope future people will get the point looking at this :)

from gridgarden.

Perrier33 avatar Perrier33 commented on May 2, 2024

grid-template-rows: 50px 0 0 0 ; works perfectly for me.

from gridgarden.

cchiennguyenn avatar cchiennguyenn commented on May 2, 2024

image
#garden {
display: grid;
grid-template-columns: 20% 20% 20% 20% 20%;
grid-template-rows: 50px 0px 0px 0px; //only your 5th row
}

#water {
grid-column: 1 / 6;
grid-row: 5 / 6;
}

from gridgarden.

astriauliya5 avatar astriauliya5 commented on May 2, 2024

imagine using 1fr 1fr 1fr 1fr 32fr

from gridgarden.

IGORPORTELAMARTINS avatar IGORPORTELAMARTINS commented on May 2, 2024

grid-template-rows: 50px 1fr 1fr 1fr 300000fr; também da certo

from gridgarden.

usizu avatar usizu commented on May 2, 2024

I got stuck here too, because repeat(4, 10px) looks correct in the graphic.

image

I got to that because initially I wanted to do repeat(5, 10px) 1fr (for the 50px) but then of course the water is misplaced in the 5th row, then I reduced the repeat to 4 rows and that's when it looks right. I got stuck because 50px / 5 = 12.5px is not something I do in my head, and when it says "create five rows in total" I think "ok, 50px / 5 = 10px".

IMO this exercise would be more clear if the water was set to the 6th row. It would feel less "gotcha".

PS. This grid garden game is really wonderful and I don't mean this comment to be perceived as critical

from gridgarden.

usizu avatar usizu commented on May 2, 2024

Can someone explain why this solution worked? image

@agraham75 I believe it correctly makes the first 50px row, then it adds three rows of 0 height, and then grid automatically adds the 5th row to fill in the remaining space (the water).

Edit: oh I guess not, I didn't notice those grid lines suggesting that the 0 height rows are not actually 0px tall.

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.