Commit Graph

1000 Commits

Author SHA1 Message Date
Brent Yorgey
03509d7ae8 fix Haddock typo 2022-10-12 15:07:10 -05:00
Tamas Zsar
727a5b26b3
Handle Ctrl-D in REPL and trigger toggling Quit Modal (#743)
Implements #345 

When Ctrl-D is received by `handleREPLEvent`, it checks if the prompt is empty (for both `CmdPrompt` and `SearchPrompt` cases). If it is empty, it calls `toggleModal`.

I'm new to Haskell in general, so if there's a better way to do this, please let me know.
2022-10-12 18:56:11 +00:00
Ondřej Šebek
4122ea5207
Add a note about installing fourmolu (#744)
- note how to install Fourmolu and run it from shell
- refactor the conventions to use subsections for easier readability
- simplify restyled arguments for Fourmolu 0.4
2022-10-12 18:23:05 +00:00
Ondřej Šebek
a7aceec9c4
Add blank world (#741)
- closes #740
2022-10-11 01:38:52 +02:00
Valentin Golev
5085f710b3
Persist the type of the last expression in the REPL UI (#733)
- adds `PolyUnit` pattern (just seemed useful?)
- persists the last type/value into the `REPLDone (Maybe (Polytype, Value))` constructor
    - `value` is not needed right now, but I'm thinking about using it for #304
    - I'm also considering if pretty-printing the last value in that cozy corner could also be a good idea
- notion of the "active" type (last or currently-executing) and the corresponding `Getter`: `replActiveType`
- show this active type in the REPL UI (fixes #692)
2022-10-07 12:10:37 +00:00
Ondřej Šebek
e1b4733f66 Bump VSCode plugin version 2022-10-06 23:18:10 +02:00
Brent Yorgey
4c793ccb85
final polishing of alpha release announcement blog post (#732) 2022-10-06 21:14:55 +00:00
Ondřej Šebek
5fad2d9a91 VSCode 0.0.7 release 2022-10-06 23:11:41 +02:00
Brent Yorgey
1731b9e873 0.1.0.1 bugfix release
Also rename `data.zip` to `swarm-data.zip`
2022-10-06 14:19:55 -05:00
Ondřej Šebek
49c4405543
Run data files (#730)
- add fallback to the swarm data directory when the run file is not found
2022-10-06 19:03:37 +00:00
Ondřej Šebek
11b8ac76a5 Fix version check when there is no GitInfo 2022-10-06 19:52:16 +02:00
Ondřej Šebek
7097b2558d
Add release badges (#725) 2022-10-06 16:59:28 +00:00
Ondřej Šebek
53b169eb07
Release version 0.1.0.0 (#727)
- bump Swarm version in Cabal
- write CHANGELOG for the first release
2022-10-06 16:39:02 +00:00
Brent Yorgey
afffe95f76
Update README with more explicit instructions about installation (#722) 2022-10-06 16:26:24 +00:00
Brent Yorgey
ce14f03d20
handle panel shortcuts before modal event handler (#728)
This way, shortcuts like M-e, M-r, etc. work even when a modal dialog is open.  Closes #723.
2022-10-06 16:25:40 +00:00
Ondřej Šebek
3fcc2bda5f
Refactor move tutorial using split and whoami (#724) 2022-10-06 15:30:41 +00:00
Ondřej Šebek
73a8784aba
Add split and text length functions (#720)
- add `split: int -> text -> (text * text)`
- add `chars: text -> int`
- test using property tests
2022-10-06 11:23:15 +00:00
Ondřej Šebek
e57743da91
Add release action (#716)
- create the release on pushed PVP-style tag
- publish the binary, zipped data and license to the release
- publish to Hackage
- closes #673
2022-10-05 23:25:29 +00:00
Ondřej Šebek
3324cf1f0c
Make multistep move tutorial (#708)
The goal is to make the move tutorial more interesting, by using multiple objectives in sequence:

- _move twice_ (the current **Moving, part 1**) teaches the `move` command
- _move six times_ (**new**) will teach about using <kbd>↑</kbd> to get previous commands in REPL and chaining with `;`
- _turn and move_ (part of the current **Moving, part 2**) teaches the `turn` command and `left`/`right`
- _repeat_ (part of the current **Moving, part 2**) will let the player enjoy reusing previous commands

The map of the next part will be revealed (🪄 🧙) upon fulfilling the objective.
```
+--+
|> |
+--+
```
move seven times:
```
+--+------+
| >       |
+--+------+
```
turn and move:
```
       +--+
       |  |
       +  |
       |  |
       |  |
+--+---+  +
|        >|
+--+------+
```
repeat:
```
+---------+
|         |
|  +------+
|  |
|  |
|  +---+--+
|        ^|
+------+  |
       |  |
       |  |
+--+---+  +
|         |
+--+------+
```

---
<sup>The number of moves and the shape itself is subject to change. 😉 </sup>
2022-10-05 23:25:20 +00:00
Brent Yorgey
7729369d50 some updates to README and COMMUNITY 2022-10-05 17:52:52 -05:00
Ondřej Šebek
956dcb9ecf Fix default robot direction
I am not sure what it was doing, but it was not what
I expected. Now it should accept missing dir field.
2022-10-05 21:37:51 +02:00
Brent Yorgey
faad903863
Add author (optional) and version (required) fields to scenarios (#719)
Closes #611 .
2022-10-05 18:01:32 +00:00
Brent Yorgey
871e68b38f mention external editors in def Tutorial challenge 2022-10-04 07:08:31 -05:00
Brent Yorgey
af6cb9b8d1 fix typo 2022-10-04 07:03:06 -05:00
Brent Yorgey
553723b83e the base now faces north by default 2022-10-03 21:22:51 -05:00
Ondřej Šebek
88eee0aaab
Rename the bug tag 2022-10-03 08:36:35 +02:00
Brent Yorgey
ffd94792cf
set up config for issue template chooser, with link to COMMUNITY (#718) 2022-10-02 23:40:38 +00:00
Brent Yorgey
5fb85328b0 better tutorial/log screenshot 2022-10-02 15:51:30 -05:00
Brent Yorgey
e58c43e16c put some screenshots in alpha release blog post 2022-10-02 15:45:28 -05:00
Ondřej Šebek
0d0cd91208
Catch release query errors (#714)
- catch `HttpException` thrown when the query to GitHub API fails
- refactor the version error handling
2022-10-02 07:11:57 +00:00
Ondřej Šebek
e13dced169
Fallback to XDG data directory (#678)
- when `datadir` is not available, try using the XDG data directory

This way the game can be installed as an executable and data files unpacked to  `~/.local/share/swarm/data`.
Notice that the XDG data folder is  `~/.local/share/swarm`; inside it is the unpacked `data`.

The alternative approach is to use the environment variable `swarm_datadir` and set that to the unpacked data folder.
That works (even after this change) but is not very beginner friendly.

Ideally, we would like to set this in Cabal when building executable, for example to `/usr/share/swarm/<version>`.
Reading through haskell/cabal#5997, it looks like that is not supported.
2022-10-01 20:40:56 +00:00
Ondřej Šebek
559a3450bd
Allow multiple robots in palette (#711)
- support specifying multiple robots in a cell
- add a test with multiple robots revealing new rooms
  - add T shaped walls
- closes #710
2022-10-01 15:26:05 +00:00
Ondřej Šebek
f3c92ca03d
Make robots direction optional (#709)
When writing scenarios, specifying the direction for system robots is annoying.
With this change robots without direction will have a default direction `down`.
2022-10-01 10:41:00 +00:00
Ondřej Šebek
0fb94ae7dd Use type constraint for step functions 2022-09-27 01:42:17 +02:00
Ondřej Šebek
03fd3e22cd
Unify move check and fix bugs (#701)
- unify move checking for move and teleport
- make `destroyIfNotBase` able to destroy system robots
- add test for destructive teleport
- closes #699
2022-09-26 23:26:35 +00:00
Brent Yorgey
5a01658883
rename unit type to unit (#697)
Closes #696.
2022-09-26 20:10:12 +00:00
Ondřej Šebek
cdd2966275
Remove backticks from backstory (#703) 2022-09-26 17:53:38 +00:00
Brent Yorgey
f003c6773e
A few updates related to speedrunning (#695)
I've updated the Swarm speedrunning wiki page at https://github.com/swarm-game/swarm/wiki/Speedrunning .  Here are a few related cleanups/links.  I'm also planning to fix #694 as part of this PR.
2022-09-25 19:30:18 +00:00
Brent Yorgey
4c8a5c7dbb add more prominent links to README 2022-09-24 14:13:04 -05:00
Brent Yorgey
4801d17978
More minor edits (#693) 2022-09-18 12:04:33 +00:00
Brent Yorgey
120b7b4b79
Remove test challenges and add some more interesting ones (#669)
Remove a couple challenges which were just there as placeholders (`test` and `drill_test`; the latter is now moved to `Testing`), and add more interesting `2048` and `hanoi` challenges.

Closes #635 .
2022-09-17 18:31:39 +00:00
Brent Yorgey
7942ac1215
Minor tweaks to tutorial and entity descriptions (#690) 2022-09-17 18:07:08 +00:00
Brent Yorgey
d0dc04a2d7
Documentation edits in preparation for alpha release (#691) 2022-09-17 15:28:13 +00:00
Brent Yorgey
effef86d22
preserve the focused scenario when rebuilding the NewGameMenu (#688)
Fixes #682.

I still don't understand why it was doing the thing before where it repeated each challenge twice, instead of just repeating the same challenge over and over again.  So that has me a little worried.  But I do understand why there was a problem --- because when we win a scenario, the menu automatically advances to the next one, but the `currentScenarioPath` is still the one we just won, as it should be so we can save the updated `ScenarioInfo` associated to the correct scenario.  But then the menu is rebuilt in order to get all the updated `ScenarioInfo` --- so we must be sure to carefully preserve whatever scenario the menu is focused on, which may or may not be the same as the one we just exited, depending on whether we won or just quit.
2022-09-17 11:32:11 +00:00
Ondřej Šebek
1b3e622655
Add swap command (#685)
- closes #684
- closes #680
2022-09-17 11:21:26 +00:00
Ondřej Šebek
91a186e354
Add easy mazes (#677)
- add one maze shaped like a cave and one shaped like a spiral
- part of #635

Co-authored-by: Brent Yorgey <byorgey@gmail.com>
2022-09-14 18:02:30 +00:00
Ondřej Šebek
914f3ad596
Fix various robot bugs (#675)
- make sure that when the hypothetical robot crashes the game does not
- allow system robots to pick up anything
- let self teleporting robots touch themselves
2022-09-11 14:54:57 +00:00
Ondřej Šebek
981583d2f7
Fix best time format (#672)
- show minutes and seconds modulo 60
2022-09-09 06:46:06 +00:00
Ondřej Šebek
4c6f6dc3f1 Make VSCode CI fool proof
It has to work somehow, I give up!
2022-09-09 00:04:00 +02:00
Ondřej Šebek
8f2affd7aa Add missing typescript build to VSCode CI 2022-09-08 23:47:28 +02:00