Skip to content

Commit

Permalink
Visualizer: get problem number from the command line
Browse files Browse the repository at this point in the history
  • Loading branch information
ForNeVeR committed Jul 8, 2023
1 parent aee80be commit 9f105e3
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
5 changes: 4 additions & 1 deletion Icfpc2023.Visualizer/ViewModels/MainWindowViewModel.fs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
namespace Icfpc2023.Visualizer.ViewModels

open System
open Icfpc2023
open ReactiveUI

Expand All @@ -12,7 +13,9 @@ type MainWindowViewModel() =
FieldViewModel(problemId, problem, solution, solutionMetadata)

member val Field =
MainWindowViewModel.LoadProblem(1)
let cmdArgs = Environment.GetCommandLineArgs() |> Array.skip 1
let problemId = if cmdArgs.Length > 0 then int cmdArgs[0] else 1
MainWindowViewModel.LoadProblem(problemId)
with get, set

member this.ProblemId = string this.Field.ProblemId
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,9 @@ $ cd Icfpc2023 && dotnet run -- [arguments here…]

### Visualizer
```console
$ dotnet run --project Icfpc2023.Visualizer
$ dotnet run --project Icfpc2023.Visualizer [-- <problemNumber>]
# or, alternately:
$ cd Icfpc2023.Visualizer && dotnet run
$ cd Icfpc2023.Visualizer && dotnet run [-- <problemNumber>]
```

### Commands
Expand Down

0 comments on commit 9f105e3

Please sign in to comment.