diff --git a/icfpc2023.Fortran/src/guess.f90 b/icfpc2023.Fortran/src/guess.f90 index 29de864..d635ccc 100644 --- a/icfpc2023.Fortran/src/guess.f90 +++ b/icfpc2023.Fortran/src/guess.f90 @@ -85,6 +85,8 @@ subroutine guess_v2(room) end do musician%volume = 1._8 do instr = 1, room%N_instruments + write(6, "(A,I0,A,I0,A)", advance="no") "Layer ", instr, " of ", room%N_instruments, repeat(" ", 20) // char(13) + flush(6) musician%instrument = instr do i = 1, size(grid(instr)%skip) musician%pos = grid(instr)%pos(i) @@ -93,6 +95,8 @@ subroutine guess_v2(room) end do end do do layer = 1, room%N_instruments + write(6, "(A,I0,A,I0,A)", advance="no") "Layer ", layer, " of ", room%N_instruments, repeat(" ", 20) // char(13) + flush(6) max_pos = maxloc(grid(layer)%value) call additional%generate_grid(max(minx, grid(layer)%pos(max_pos(1))%x - 10._8), & min(maxx, grid(layer)%pos(max_pos(1))%x + 10._8), & diff --git a/icfpc2023.Fortran/src/main.f90 b/icfpc2023.Fortran/src/main.f90 index 64d1aa0..4954cc1 100644 --- a/icfpc2023.Fortran/src/main.f90 +++ b/icfpc2023.Fortran/src/main.f90 @@ -10,12 +10,12 @@ program main call room%load(filename) call room%print() e1 = room%score() + print *, "Old: ", e1 call guess_v2(room) e2 = room%score() - print *, "Old: ", e1 print *, "New: ", e2 print "(A,F15.2,A,F8.2,A)", "Improvement: ", e2-e1, "; ", (e2-e1)/abs(e1)*100, "%" - if (e2 > e1 .or. .true.) then + if (e2 > e1) then call room%dump(trim(filename)//".new", "FoxtranForV2") end if end program main