Closed TomPradat closed 3 years ago
Hi. Thanks for the report. What language is this?
This is Javascript 👍
Le lun. 31 mai 2021 à 23:26, Jeremy Walker @.***> a écrit :
Hi. Thanks for the report. What language is this?
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/exercism/v3-beta/issues/41#issuecomment-851690442, or unsubscribe https://github.com/notifications/unsubscribe-auth/AD3KNIGU5QC2Q5ASWAA6SN3TQP5IXANCNFSM453N2CFQ .
Thanks. Would you mind pasting the actual code in here so I can try and reproduce pls! :)
(cc @joshgoebel too in case it's obvious to you)
(Btw, at a glance it looks like you might not be closing a string before we get to this bit of the code - either a mistake in your code or a mistake in some part of the highlighter)
Here is the code :
//
// This is only a SKELETON file for the 'Kindergarten Garden' exercise.
// It's been provided as a convenience to get you started writing code faster.
//
const DEFAULT_STUDENTS = [
'Alice',
'Bob',
'Charlie',
'David',
'Eve',
'Fred',
'Ginny',
'Harriet',
'Ileana',
'Joseph',
'Kincaid',
'Larry',
];
const PLANT_CODES = {
G: 'grass',
V: 'violets',
R: 'radishes',
C: 'clover',
};
export class Garden {
constructor(diagram, students = DEFAULT_STUDENTS) {
this.diagram = diagram;
this.students = students.sort();
}
plants(student) {
const [firstRow, secondRow] = this.diagram.split("\n");
const studentIndex = this.students.indexOf(student);
const plantsColumnIndex = studentIndex * 2;
const plantsOfTheFirstRowOwnedByTheStudent = firstRow.slice(plantsColumnIndex, plantsColumnIndex + 2);
const plantsOfTheSecondRowOwnedByTheStudent = secondRow.slice(plantsColumnIndex, plantsColumnIndex + 2);
return [...plantsOfTheFirstRowOwnedByTheStudent, ...plantsOfTheSecondRowOwnedByTheStudent].map(plantCode => PLANT_CODES[plantCode]);
}
}
It works well when I'm in the editor btw
Too bad the snap is missing lines 1-13... I'd imagine there is a syntax error and a missing quote... I don't see any problem with our engine.
@joshgoebel Here it is :)
It looks like it's not getting highlighted as JS but rather some other language, which would be an Exercism bug? Are we not passing the languages explicitly? We definitely should be.
Hmm, yeah. This is a bug our end. The wrong language is getting set. I'll take a look.
Fixed in https://github.com/exercism/website/pull/1049 :)
Let me know if you need more information