Skip to content

Commit dc6ae9c

Browse files
[ Flower Field ] Deprecate minesweeper for flower-field (#2575)
* [ Flower Field ] Deprecate minesweeper for flower-field See: https://forum.exercism.org/t/suggestion-deprecate-minesweeper-for-flower-field/17967 * Changed 404 link to Wikipedia * Remove whitespace Co-authored-by: Isaac Good <[email protected]> * Linting and minor wording * Adjust blurb to match intro * Adjust linting rule to preserve multi-lines for readability --------- Co-authored-by: Isaac Good <[email protected]>
1 parent 2d86a98 commit dc6ae9c

File tree

6 files changed

+245
-0
lines changed

6 files changed

+245
-0
lines changed

bin/format-array.rb

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,10 @@
4848
'array' => :multi_line_deep,
4949
'expected' => :multi_line,
5050
},
51+
'flower-field' => {
52+
'garden' => :multi_line_unless_single,
53+
'expected' => :multi_line_unless_single,
54+
},
5155
'forth' => {
5256
'instructions' => :multi_line_unless_single,
5357
},
Lines changed: 201 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,201 @@
1+
{
2+
"exercise": "flower-field",
3+
"comments": [
4+
"The expected outputs are represented as arrays of strings to",
5+
"improve readability in this JSON file.",
6+
"Your track may choose whether to present the input as a single",
7+
"string (concatenating all the lines) or as the list."
8+
],
9+
"cases": [
10+
{
11+
"uuid": "237ff487-467a-47e1-9b01-8a891844f86c",
12+
"description": "no rows",
13+
"property": "annotate",
14+
"input": {
15+
"garden": []
16+
},
17+
"expected": []
18+
},
19+
{
20+
"uuid": "4b4134ec-e20f-439c-a295-664c38950ba1",
21+
"description": "no columns",
22+
"property": "annotate",
23+
"input": {
24+
"garden": [""]
25+
},
26+
"expected": [""]
27+
},
28+
{
29+
"uuid": "d774d054-bbad-4867-88ae-069cbd1c4f92",
30+
"description": "no flowers",
31+
"property": "annotate",
32+
"input": {
33+
"garden": [
34+
" ",
35+
" ",
36+
" "
37+
]
38+
},
39+
"expected": [
40+
" ",
41+
" ",
42+
" "
43+
]
44+
},
45+
{
46+
"uuid": "225176a0-725e-43cd-aa13-9dced501f16e",
47+
"description": "garden full of flowers",
48+
"property": "annotate",
49+
"input": {
50+
"garden": [
51+
"***",
52+
"***",
53+
"***"
54+
]
55+
},
56+
"expected": [
57+
"***",
58+
"***",
59+
"***"
60+
]
61+
},
62+
{
63+
"uuid": "3f345495-f1a5-4132-8411-74bd7ca08c49",
64+
"description": "flower surrounded by spaces",
65+
"property": "annotate",
66+
"input": {
67+
"garden": [
68+
" ",
69+
" * ",
70+
" "
71+
]
72+
},
73+
"expected": [
74+
"111",
75+
"1*1",
76+
"111"
77+
]
78+
},
79+
{
80+
"uuid": "6cb04070-4199-4ef7-a6fa-92f68c660fca",
81+
"description": "space surrounded by flowers",
82+
"property": "annotate",
83+
"input": {
84+
"garden": [
85+
"***",
86+
"* *",
87+
"***"
88+
]
89+
},
90+
"expected": [
91+
"***",
92+
"*8*",
93+
"***"
94+
]
95+
},
96+
{
97+
"uuid": "272d2306-9f62-44fe-8ab5-6b0f43a26338",
98+
"description": "horizontal line",
99+
"property": "annotate",
100+
"input": {
101+
"garden": [" * * "]
102+
},
103+
"expected": ["1*2*1"]
104+
},
105+
{
106+
"uuid": "c6f0a4b2-58d0-4bf6-ad8d-ccf4144f1f8e",
107+
"description": "horizontal line, flowers at edges",
108+
"property": "annotate",
109+
"input": {
110+
"garden": ["* *"]
111+
},
112+
"expected": ["*1 1*"]
113+
},
114+
{
115+
"uuid": "a54e84b7-3b25-44a8-b8cf-1753c8bb4cf5",
116+
"description": "vertical line",
117+
"property": "annotate",
118+
"input": {
119+
"garden": [
120+
" ",
121+
"*",
122+
" ",
123+
"*",
124+
" "
125+
]
126+
},
127+
"expected": [
128+
"1",
129+
"*",
130+
"2",
131+
"*",
132+
"1"
133+
]
134+
},
135+
{
136+
"uuid": "b40f42f5-dec5-4abc-b167-3f08195189c1",
137+
"description": "vertical line, flowers at edges",
138+
"property": "annotate",
139+
"input": {
140+
"garden": [
141+
"*",
142+
" ",
143+
" ",
144+
" ",
145+
"*"
146+
]
147+
},
148+
"expected": [
149+
"*",
150+
"1",
151+
" ",
152+
"1",
153+
"*"
154+
]
155+
},
156+
{
157+
"uuid": "58674965-7b42-4818-b930-0215062d543c",
158+
"description": "cross",
159+
"property": "annotate",
160+
"input": {
161+
"garden": [
162+
" * ",
163+
" * ",
164+
"*****",
165+
" * ",
166+
" * "
167+
]
168+
},
169+
"expected": [
170+
" 2*2 ",
171+
"25*52",
172+
"*****",
173+
"25*52",
174+
" 2*2 "
175+
]
176+
},
177+
{
178+
"uuid": "dd9d4ca8-9e68-4f78-a677-a2a70fd7a7b8",
179+
"description": "large garden",
180+
"property": "annotate",
181+
"input": {
182+
"garden": [
183+
" * * ",
184+
" * ",
185+
" * ",
186+
" * *",
187+
" * * ",
188+
" "
189+
]
190+
},
191+
"expected": [
192+
"1*22*1",
193+
"12*322",
194+
" 123*2",
195+
"112*4*",
196+
"1*22*2",
197+
"111111"
198+
]
199+
}
200+
]
201+
}
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
# Instructions
2+
3+
Your task is to add flower counts to empty squares in a completed Flower Field garden.
4+
The garden itself is a rectangle board composed of squares that are either empty (`' '`) or a flower (`'*'`).
5+
6+
For each empty square, count the number of flowers adjacent to it (horizontally, vertically, diagonally).
7+
If the empty square has no adjacent flowers, leave it empty.
8+
Otherwise replace it with the count of adjacent flowers.
9+
10+
For example, you may receive a 5 x 4 board like this (empty spaces are represented here with the '·' character for display on screen):
11+
12+
```text
13+
·*·*·
14+
··*··
15+
··*··
16+
·····
17+
```
18+
19+
Which your code should transform into this:
20+
21+
```text
22+
1*3*1
23+
13*31
24+
·2*2·
25+
·111·
26+
```
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
# Introduction
2+
3+
[Flower Field][history] is a compassionate reimagining of the popular game Minesweeper.
4+
The object of the game is to find all the flowers in the garden using numeric hints that indicate how many flowers are directly adjacent (horizontally, vertically, diagonally) to a square.
5+
"Flower Field" shipped in regional versions of Microsoft Windows in Italy, Germany, South Korea, Japan and Taiwan.
6+
7+
[history]: https://web.archive.org/web/20020409051321fw_/http://rcm.usr.dsi.unimi.it/rcmweb/fnm/

exercises/flower-field/metadata.toml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
title = "Flower Field"
2+
blurb = "Mark all the flowers in a garden."
3+
deep_dive_youtube_id = "dLT2h2hODhs"
4+
deep_dive_blurb = "We explore nested for loops, clever use of min/max to simplify bounds checking, functional pipelines and using two-dimensional matrices."

exercises/minesweeper/.deprecated

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
**NOTE: This exercise has been deprecated**
2+
Your track should implement "flower-field" instead.
3+
https://forum.exercism.org/t/suggestion-deprecate-minesweeper-for-flower-field/17967

0 commit comments

Comments
 (0)