Code Monkey home page Code Monkey logo

Comments (18)

JoshDevHub avatar JoshDevHub commented on May 29, 2024

I think it's a cool idea to bring this stuff in-house for a couple of reasons:

  1. Similar to the exercises in foundations, our provided tests can make sure learners' solutions are correct and properly consider certain edge cases.
  2. One of the solutions in the JS exercises (problem 6) is incorrect. There's also quite a bit of dated syntax.
  3. We'd have full control over what the problems are, how many there are, etc.

Anyways, I'll check with the team and see if they agree.

from curriculum.

github-actions avatar github-actions commented on May 29, 2024

This issue is stale because it has had no activity for the last 30 days.

from curriculum.

JoshDevHub avatar JoshDevHub commented on May 29, 2024

Alright revisiting this because I have some time to pursue it.

Is this still something you're interested in working on @nikitarevenco ?

from curriculum.

nikitarevenco avatar nikitarevenco commented on May 29, 2024

Alright revisiting this because I have some time to pursue it.

Is this still something you're interested in working on @nikitarevenco ?

Yes, I'm happy to work on this!

from curriculum.

JoshDevHub avatar JoshDevHub commented on May 29, 2024

Awesome.

Before we start, we can think some about what exercises we want to do. One of the nice things about moving this in-house is that we have full control over the problems. We could also use the same problem set for both paths.

I really like the following ones because they actually present good usecases for recursion rather than being "loop" problems we're telling the learner to think of in a recursive way.

  • contains() from the JS challenges
  • totalIntegers() from the JS challenges
  • sumSquares() from the JS challenges
  • #flatten from the Ruby challenges

It's also probably nice to have an easier one in there like a factorial problem. I probably don't want to do a Fibonacci problem because there's already a project using it that comes later.

Do you have any opinions on this? @nikitarevenco

from curriculum.

nikitarevenco avatar nikitarevenco commented on May 29, 2024

Awesome.

Before we start, we can think some about what exercises we want to do. One of the nice things about moving this in-house is that we have full control over the problems. We could also use the same problem set for both paths.

I really like the following ones because they actually present good usecases for recursion rather than being "loop" problems we're telling the learner to think of in a recursive way.

  • contains() from the JS challenges
  • totalIntegers() from the JS challenges
  • sumSquares() from the JS challenges
  • #flatten from the Ruby challenges

It's also probably nice to have an easier one in there like a factorial problem. I probably don't want to do a Fibonacci problem because there's already a project using it that comes later.

Do you have any opinions on this? @nikitarevenco

Yeah, great ideas. I like the flatten challenge and having the exercises go from easier, starting with the factorial to more difficult sounds like a plan.

Some additional ideas for the exercises

  • Function to find the greatest common divisor of an array of integers, eg if we input 24, 60 and 84 it will return 12.

  • A classic one is the tower of hanoi, we have 3 stacks, the first stack is filled with n consecutive integers, the others are empty. The numbers can only be placed onto a stack if the number before is smaller and can only be moved one at a time.

  • I think another interesting one that would be a great recursive function would be like pascal(n) which will return the nth row of the pascal's triangle in an array

  • Since we already have a calculator exercise, would be interesting to make a recursive version. The task is to make a calculator(string) function that accepts a mathematical expression like (3รท9)ร—(3+2) and evaluates it. Learners will not be allowed to use eval

  • permutations function that accepts a string and finds all of the possible permutations of every character in the string

from curriculum.

JoshDevHub avatar JoshDevHub commented on May 29, 2024

I think most of those options have cool potential. I'm maybe a bit skeptical of greatest common denominator. It's definitely a famous recursion problem, but I don't think learners are going to be able to just come up with Euclid's algorithm on the spot. Maybe the README for the exercise could mention it?

Anyways let's proceed with adding all of these in (the ones in my list and the ones in yours), and we can filter out the ones that don't work when it comes to review time and we get some outside input.

So for your part, you want to add the new exercises to our javascript exercises repo. When you make your PR there, you'll want to reference this issue. I'll handle adding them to the ruby exercises repo.

from curriculum.

JoshDevHub avatar JoshDevHub commented on May 29, 2024

Actually let's keep things a bit constrained to start. Maybe we can move faster after we get things rolling, but for now, let's try to keep PRs small. We'll definitely need at least a JS maintainer to look over the new exercises you add in the javascript-exercises repo, and I'd rather not hit the reviewer with a massive PR ๐Ÿ˜…

So let's just work on a PR for a factorial exercise for right now and plan to move slowly unless/until reviewers are okay with looking over more work.

Does that sound good @nikitarevenco ?

from curriculum.

nikitarevenco avatar nikitarevenco commented on May 29, 2024

Actually let's keep things a bit constrained to start. Maybe we can move faster after we get things rolling, but for now, let's try to keep PRs small. We'll definitely need at least a JS maintainer to look over the new exercises you add in the javascript-exercises repo, and I'd rather not hit the reviewer with a massive PR ๐Ÿ˜…

So let's just work on a PR for a factorial exercise for right now and plan to move slowly unless/until reviewers are okay with looking over more work.

Does that sound good @nikitarevenco ?

Oh yeah, certainly. It would be better to split a single massive PR into many smaller ones.

from curriculum.

nikitarevenco avatar nikitarevenco commented on May 29, 2024

Actually let's keep things a bit constrained to start. Maybe we can move faster after we get things rolling, but for now, let's try to keep PRs small. We'll definitely need at least a JS maintainer to look over the new exercises you add in the javascript-exercises repo, and I'd rather not hit the reviewer with a massive PR ๐Ÿ˜…

So let's just work on a PR for a factorial exercise for right now and plan to move slowly unless/until reviewers are okay with looking over more work.

Does that sound good @nikitarevenco ?

Take a look at the new exercise

from curriculum.

nikitarevenco avatar nikitarevenco commented on May 29, 2024

How many more exercises are we going to add?

I'll give a brief explanation of the current ideas I have that are currently draft PRs and I haven't started working on.

  • recursiveCalculator: Takes in a string like 4 - (3 + 9) and evaluates it. can be a lot more nested. The problem with this exercise that I've realised it is a lot more about string manipulation than it is about recursion. I've learnt quite a lot of regex while attempting to come up with a solution for it. While it is nice to be able to understand regex now, I don't think we want to have this as an exercise as the main goal of these new sets of exercises is to practice recursion.

  • pascal: Get the nth row of the pascals triangle. Like pascal(3) returns [1, 3, 3, 1]. And so on, negative numbers supported.

  • tower of hanoi: Classic problem with n disks and 3 stacks. We start at the first stack. we want to move our disks to the third tower, but we can only move one at a time.

Let's decide which ones we want to keep and which ones we want to work on in the future.

@MaoShizhong @JoshDevHub

from curriculum.

MaoShizhong avatar MaoShizhong commented on May 29, 2024

At first glance, Tower of Hanoi seems like a classic puzzle suited for recursion. I haven't actually looked into it myself, so can't comment on whether it'd be suitable to include in the proposed exercises when you also take into account how many there would be.

Calculator, I'll push back on. Those challenges would not be suited to recursion, so doing them recursively would just be shoehorning recursion where it doesn't belong.

Can't comment at this time on Pascal in terms of suitability as an exercise to add, nor when also considering the context of the other exercises.

from curriculum.

MaoShizhong avatar MaoShizhong commented on May 29, 2024

Very honestly, I think just having approx. 5-6 exercises is plenty. Especially if we're also considering porting recursive fibonacci and/or merge sort over as well.

For me, something like

  1. Factorial
  2. Fibonacci
  3. Contains
  4. Total Integers
  5. Permutations
  6. Tower of Hanoi

Maybe also merge sort somewhere there as well, but I've no strong feelings for whether we need or don't need it.

At a glance seems sufficient for that section. As usual, just my personal opinion taking into account the pedagogy of the whole CS section and the "flow" of the course.

from curriculum.

nikitarevenco avatar nikitarevenco commented on May 29, 2024

Very honestly, I think just having approx. 5-6 exercises is plenty. Especially if we're also considering porting recursive fibonacci and/or merge sort over as well.

For me, something like

  1. Factorial
  2. Fibonacci
  3. Contains
  4. Total Integers
  5. Permutations
  6. Tower of Hanoi

Maybe also merge sort somewhere there as well, but I've no strong feelings for whether we need or don't need it.

At a glance seems sufficient for that section. As usual, just my personal opinion taking into account the pedagogy of the whole CS section and the "flow" of the course.

I agree with you that about 6ish should be good. I think that pascal is worth including though since I feel like its an interesting challenge, thoughts?

from curriculum.

MaoShizhong avatar MaoShizhong commented on May 29, 2024

Hmmmm, partially due to unfamiliarity with a Pascal solution, I'd probably prefer including merge sort to be honest.

The sorting algo itself is quite a unique pattern compared to the other exercises, and lends itself very well to recursion. So on reflection, I think it can teach good lessons that warrant its inclusion. And I'm hesitant to go beyond 7, given the current exercises' complexities.

from curriculum.

MaoShizhong avatar MaoShizhong commented on May 29, 2024

Very honestly, I think just having approx. 5-6 exercises is plenty. Especially if we're also considering porting recursive fibonacci and/or merge sort over as well.

For me, something like

  1. Factorial
  2. Fibonacci
  3. Contains
  4. Total Integers
  5. Permutations
  6. Tower of Hanoi

Maybe also merge sort somewhere there as well, but I've no strong feelings for whether we need or don't need it.

At a glance seems sufficient for that section. As usual, just my personal opinion taking into account the pedagogy of the whole CS section and the "flow" of the course.

@JoshDevHub thoughts on the above as the order of new exercises? Merge sort can be throw in there as a 7th (but put somewhere in the middle, I feel). Not all too familiar with the Pascal suggestion but am more familiar with merge sort and feel it would be good to have merge sort in there as well. Hence I'm leaning towards omitting the Pascal exercise due to a quantity thing.

from curriculum.

nikitarevenco avatar nikitarevenco commented on May 29, 2024

Very honestly, I think just having approx. 5-6 exercises is plenty. Especially if we're also considering porting recursive fibonacci and/or merge sort over as well.
For me, something like

  1. Factorial
  2. Fibonacci
  3. Contains
  4. Total Integers
  5. Permutations
  6. Tower of Hanoi

Maybe also merge sort somewhere there as well, but I've no strong feelings for whether we need or don't need it.
At a glance seems sufficient for that section. As usual, just my personal opinion taking into account the pedagogy of the whole CS section and the "flow" of the course.

@JoshDevHub thoughts on the above as the order of new exercises? Merge sort can be throw in there as a 7th (but put somewhere in the middle, I feel). Not all too familiar with the Pascal suggestion but am more familiar with merge sort and feel it would be good to have merge sort in there as well. Hence I'm leaning towards omitting the Pascal exercise due to a quantity thing.

I have already the Pascal and Hanoi solutions down and I think they are very interesting. Once I have internet on my computer I will publish them as PRs. I think the solutions are very interesting for both.

from curriculum.

nikitarevenco avatar nikitarevenco commented on May 29, 2024

So that makes the following new exercises:

  • Factorial
  • Contains
  • Total Integers
  • Permutations
  • Pascal
  • Hanoi

And the two ported from existing project:

  • Merge Sort
  • Fibonacci

from curriculum.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.