the-winter / codingjs Goto Github PK
View Code? Open in Web Editor NEWA static website to do CodingBat problems in JavaScript.
Home Page: https://the-winter.github.io/codingjs
A static website to do CodingBat problems in JavaScript.
Home Page: https://the-winter.github.io/codingjs
Thank you for putting this together. It's been helpful to be able to try the same exercises in Java and Python, thanks to Professor Nick Parlante of Stanford, and also being able to do those same exercises in JavaScript, thanks to the contributors here.
Would you mind adding a license to the repo? Thanks again!
firstHalf solution is the full string instead of half of it.
#24 was supposed to fix this but it looks like the bug is still present
codingjs/src/data/logicSolutions.js
Lines 402 to 404 in b4dc583
makeChocolate(1, 2, 7) → 2
In this case, where small + big*5 > goal is true but the number of small bars is not great enough to reach the goal, it should give -1 but is not.
there is no option on UI to compare the solution. It'll be great to have one link which can display the recommended solution.
The prompt says to sort the array using .sort() as one should when trying to find the median of the array. However, the solutions provided are with the arrays being unsorted. The solution should first sort the array properly and then find the median as to be in line with the prompt.
The code needs to be slightly modified to appropriately display "<" less than or ">" greater than signs within the HTML. This issue seems to impact a few of the String exercises. The tests work properly; however, the example results do not appear correctly and can confuse folks. See the following string exercises:
makeTags: https://the-winter.github.io/codingjs/exercise.html?name=makeTags&title=String-1
Appears like:
makeOutWord('<<>>', 'Yay') → <>
makeOutWord('<<>>', 'WooHoo') → <>
makeOutWord('[[]]', 'word') → [[word]]
Should appear like:
makeOutWord("<<>>", "Yay") → "<<Yay>>"
makeOutWord("<<>>", "WooHoo") → "<<WooHoo>>"
makeOutWord("[[]]", "word") → "[[word]]"
makeOutWord: https://the-winter.github.io/codingjs/exercise.html?name=makeOutWord&title=String-1
Appears like:
makeTags('i', 'Yay') → Yay
makeTags('i', 'Hello') → Hello
makeTags('cite', 'Yay') → Yay
Should appear like:
makeTags("i", "Yay") → "<i>Yay</i>"
makeTags("i", "Hello") → "<i>Hello</i>"
makeTags("cite", "Yay") → "<cite>Yay</cite>"
To fix this, I would set these values equal to .textContent
as opposed to .innerHTML
. Or you could do a replace with HTML entities: .replace('<','<').replace('>','>')
Two problems share the name "lastDigit". As a result, the second one is inaccessible.
Hi all, I noticed the provided solution for String-3 -- withoutString is incorrect
It preserves only a single space in between matches when it should preserve all spaces. For example:
withoutString("This is a FISH", "IS")
returns "Th░a░FH"
(length 7) when it should return "Th░░a░FH"
(length 8)
💡 spaces replaced by ░
This RegEx approach then doesn't pass all the tests in CodingJS, but the same approach in Java does in CodingBat.com
function withoutString(base, remove){
let reg = new RegExp(remove, 'gi')
return base.replace(reg, '')
}
The same approach in Java in the Official CodingBat String-3 > withoutString
public String withoutString(String base, String remove) {
return base.replaceAll("(?i)" + remove, "");
}
Is this project active? I could submit a PR for this. I'm also interested in becoming a longer term contributor as some of my students use your website.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.