Skip to content

Commit

Permalink
Improve gen/GEN generation from cases.gen
Browse files Browse the repository at this point in the history
  • Loading branch information
Virv12 committed Dec 5, 2023
1 parent 5b45d05 commit 39831ec
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions task-maker-format/src/ioi/format/italian_yaml/cases_gen.rs
Original file line number Diff line number Diff line change
Expand Up @@ -227,12 +227,11 @@ where
for entry in &self.result {
match entry {
TaskInputEntry::Subtask(subtask) => {
let _ = writeln!(gen, "\n# Subtask {}", subtask.id);
let _ = writeln!(gen, "#ST: {}", subtask.max_score);
if let Some(name) = &subtask.name {
let _ = writeln!(gen, "\n# Subtask {}: {}", subtask.id, name);
} else {
let _ = writeln!(gen, "\n# Subtask {}", subtask.id);
let _ = writeln!(gen, "#STNAME: {}", name);
}
let _ = writeln!(gen, "#ST: {}", subtask.max_score);
if let Some(constraints) = self.subtask_constraints.get(subtask.id as usize) {
for constr in constraints {
let _ = writeln!(gen, "# {:?}", constr);
Expand Down Expand Up @@ -529,7 +528,6 @@ where
None
};
self.subtask_name = name.clone();
// FIXME: the cases.gen format does not yet support giving the subtasks a name.
self.result.push(TaskInputEntry::Subtask(SubtaskInfo {
id: self.subtask_id,
name,
Expand Down

0 comments on commit 39831ec

Please sign in to comment.