Skip to content

Commit

Permalink
reviewを受けて修正
Browse files Browse the repository at this point in the history
  • Loading branch information
taisii committed Feb 22, 2024
1 parent 4ca9de9 commit f1962e6
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 15 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ const ProblemPage: NextPage<{ params: { courseId: string; programId: string } }>
const checkPointLines = [2, 6, 8, 12];

const [selectedLanguageId, setSelectedLanguageId] = useState('');
const [problemProgram, setProblemProgram] = useState<GeneratedProgram>();
const [problemProgram, setProblemProgram] = useState<GeneratedProgram>({ displayProgram: '', excuteProgram: '' });
const [step, setStep] = useState<ProblemType>('normal');
const [beforeCheckPointLine, setBeforeCheckPointLine] = useState(0);
const [currentCheckPointLine, setCurrentCheckPointLine] = useState(checkPointLines[0]);
Expand All @@ -43,8 +43,6 @@ const ProblemPage: NextPage<{ params: { courseId: string; programId: string } }>
};

const ProblemComponent: React.FC = () => {
// problemProgramがundefinedの時の処理。どうしたらいいですか。
if (!problemProgram) return <></>;
switch (step) {
case 'normal': {
return (
Expand Down
16 changes: 4 additions & 12 deletions src/problems/problemData.ts
Original file line number Diff line number Diff line change
Expand Up @@ -92,25 +92,17 @@ public class Straight {
curve: {
js: `
const character = new Character();
for (let i = 0; i < <3-10>; i++) {
character.moveForward();
}
for (let i = 0; i < <3-10>; i++) { character.moveForward(); }
character.turnLeft();
for (let i = 0; i < <3-5>; i++) {
character.moveForward();
}
for (let i = 0; i < <3-5>; i++) { character.moveForward(); }
`.trim(),
java: `
public class Curve {
public static void main(String[] args) {
var character = new Character();
for (int i = 0; i < <3-10>; i++) {
character.moveForward();
}
for (int i = 0; i < <3-10>; i++) { character.moveForward(); }
character.turnLeft();
for (int i = 0; i < <3-5>; i++) {
character.moveForward();
}
for (int i = 0; i < <3-5>; i++) { character.moveForward(); }
}
}
`.trim(),
Expand Down

0 comments on commit f1962e6

Please sign in to comment.