File tree Expand file tree Collapse file tree 1 file changed +8
-1
lines changed
Expand file tree Collapse file tree 1 file changed +8
-1
lines changed Original file line number Diff line number Diff line change @@ -69,8 +69,15 @@ end function connection_t_not_equal
6969 function solution_t_to_json (solution ) result(json)
7070 class(solution_t), intent (in ) :: solution
7171 character (len= :), allocatable :: json
72+ character (len= 4 ) :: tmp
7273 integer :: i
73- json = ' "startingRoom": 1, "connections": [ '
74+ json = ' "map": { "rooms": [ '
75+ do i = 1 , size (solution% connections) / 6
76+ write (tmp, ' (I0)' ) mod (i-1 , 4 )
77+ json = json // trim (tmp)
78+ if (i /= size (solution% connections) / 6 ) json = json // ' , '
79+ end do
80+ json = json // ' ], "startingRoom": 1, "connections": [ '
7481 do i = 1 , size (solution% connections)
7582 json = json // solution% connections(i)% to_json()
7683 if (i /= size (solution% connections)) json = json // ' , '
You can’t perform that action at this time.
0 commit comments