public void SavePuzzle(Solved solved, int blockId) { var text = solved.FormatSolution(); var fileName = Path.Combine(FileHelper.PatchDirectoryName("problems"), "puzzles", $"block{blockId:000}.sol"); File.WriteAllText(fileName, text); Save(solved, 500 + blockId); }
public void Save(Solved solved, int id, string suffix = null) { var text = solved.FormatSolution(); var fileName = Path.Combine(FileHelper.PatchDirectoryName("problems"), "all", $"prob-{id:000}{suffix}.sol"); var buyFileName = Path.Combine(FileHelper.PatchDirectoryName("problems"), "all", $"prob-{id:000}{suffix}.buy"); File.WriteAllText(fileName, text); File.WriteAllText(buyFileName, solved.FormatBuy()); }