exercism / v3

The work-in-progress project for developing v3 tracks
https://v3.exercism.io
Other
170 stars 162 forks source link

[C#] Implement new Concept Exercise: do-while-loops #1631

Closed mikedamay closed 4 years ago

mikedamay commented 4 years ago

This issue describes how to implement the do-while-loops concept exercise for the C# track.

Getting started

Please please please read the docs before starting. Posting PRs without reading these docs will be a lot more frustrating for you during the review cycle, and exhaust Exercism's maintainers' time. So, before diving into the implementation, please read up on the following documents:

Please also watch the following video:

Goal

The goal of this exercise is to teach the student how and when to use do keyword in C#.

Learning objectives

Out of scope

Concepts

Prerequisites

There may be other pre-requisites depending on the story.

Resources to refer to

Hints

do documentation provices an introduction to do loops.

After

do documentation provices an introduction to do loops.

Representer

This exercise does not require any specific representation logic to be added to the representer.

Analyzer

This exercise does not require any specific analyzer logic to be added to the analyzer.

Implementing

To implement this exercise, please follow these instructions.

Help

If you have any questions while implementing the exercise, please post the questions as comments in this issue.

mikedamay commented 4 years ago

I am thinking of arrays of numbers received from some other system which need to be grouped and totaled. Each group of numbers is terminated by a zero. This is a stone cold fit for do...while but extremely artificial. Using the more natural char runs the risk that the student will convert the array to a string and use Split(). A TextReader or Stream would make things more natural but I did not want to make a big topic like that a dependency for introductory material like this.

Any comments would be welcome.

ErikSchierboom commented 4 years ago

I am thinking of arrays of numbers received from some other system which need to be grouped and totaled. Each group of numbers is terminated by a zero. This is a stone cold fit for do...while but extremely artificial. Using the more natural char runs the risk that the student will convert the array to a string and use Split(). A TextReader or Stream would make things more natural but I did not want to make a big topic like that a dependency for introductory material like this.

Any comments would be welcome.

I agree with everything said here. If we would use char we could use an analyzer to verify that the student used a do...while loop. That said, an array of numbers could work, if we maybe come up with a nice-ish story around it. Maybe we could have the array of numbers be some sort of communication or encryption protocol?

mikedamay commented 4 years ago

Closed by #1737 which adds the do-while concept to floating-point-numbers where while-loops are a concept as a discussion point only.