Skip to content

Commit 62168c6

Browse files
author
Rafa Paradela
committed
Distribution: Merge pull request scala-exercises#54 from kpashka/master
1 parent d3684cf commit 62168c6

File tree

5 files changed

+26
-5
lines changed

5 files changed

+26
-5
lines changed

dist/index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<!DOCTYPE html> <html class=no-js lang=en> <head> <meta charset=utf-8> <meta name=viewport content="width=device-width"> <link rel="shortcut icon" href=images/2c11a128.favicon.png> <!-- Update your html tag to include the itemscope and itemtype attributes. --> <html itemscope itemtype=http://schema.org/Article> <!-- Place this data between the <head> tags of your website --> <title>Scala Exercises | The easy way to learn Scala</title> <meta name=description content="Introducing Scala Exercises: Quick lessons that will get you on your way to learning Scala in no time."> <meta name=keywords content="Scala, Koans, Exercises, Scala Koans, Open Source, Lessons"> <meta name=author content="47 Degrees"> <!-- Schema.org markup for Google+ --> <meta itemprop=name content="Scala Exercises"> <meta itemprop=description content="Introducing Scala Exercises: Quick lessons that will get you on your way to learning Scala in no time."> <meta itemprop=image content=http://scala-exercises.47deg.com/static/social_image.jpg> <!-- Twitter Card data --> <meta name=twitter:card content=summary_large_image> <meta name=twitter:site content=@47deg> <meta name=twitter:title content="Scala Exercises"> <meta name=twitter:description content="The easy way to learn Scala."> <meta name=twitter:creator content=@47deg> <!-- Twitter summary card with large image must be at least 280x150px --> <meta name=twitter:image:src content=http://scala-exercises.47deg.com/static/social_image_h.jpg> <!-- Publisher Google Plus --> <meta name=twitter:image:src content=http://scala-exercises.47deg.com/static/social_image_h.jpg> <!-- Open Graph data --> <meta property=og:title content="Scala Exercises"> <meta property=og:type content="article"> <meta property=og:url content="http://scala-exercises.47deg.com/"> <meta property=og:image content="http://scala-exercises.47deg.com/static/social_image.jpg"> <meta property=og:description content="The easy way to learn Scala."> <meta property=og:site_name content="Scala Exercises"> <meta property=article:published_time content="2014-12-04T05:59:00+01:00"> <meta property=article:modified_time content="2014-12-04T05:59:00+01:00"> <meta property=article:section content="Home"> <meta property=article:tag content="Scala"> <!-- Place favicon.ico and apple-touch-icon.png in the root directory --> <link rel=stylesheet href=styles/e9ec9abd.main.css> <script src=scripts/vendor/3e1dbd5e.modernizr.js></script> <link rel=stylesheet href="//cdnjs.cloudflare.com/ajax/libs/animate.css/3.1.1/animate.min.css"> <body> <!--[if lt IE 10]>
22
<p class="browsehappy">You are using an <strong>outdated</strong> browser. Please <a href="http://browsehappy.com/">upgrade your browser</a> to improve your experience.</p>
3-
<![endif]--> <header id=intro> <div class=content-image></div> <div class="presentation animated fadeInDown"> <h1>Scala Exercises</h1> <p class=lead>The easy way to learn Scala.</p> <p class=lead> <button type=button class="btn btn-primary btn-lg" onclick="moveToDiv('content')">GET STARTED</button> </p> <div id=gitHubLayer> <a target=_blank href=https://github.com/47deg/scala-exercises> <i class="fa fa-github fa-main"></i><br>Contribute </a> <div class=row> <div class=col-xs-4> <a class=gitHubWidget target=_blank href=https://github.com/47deg/scala-exercises/watchers> <h2><i class="fa fa-eye"></i> <span id=eyes>00</span></h2> </a> </div> <div class=col-xs-4> <a class=gitHubWidget target=_blank href=https://github.com/47deg/scala-exercises/stargazers> <h2><i class="fa fa-star"></i> <span id=stars>00</span></h2> </a> </div> <div class=col-xs-4> <a class=gitHubWidget target=_blank href=https://github.com/47deg/scala-exercises/fork> <h2><i class="fa fa-code-fork"></i> <span id=forks>00</span></h2> </a> </div> </div> </div> </div> </header> <section id=content> <div class=container> <div class=introduction> <div class=row> <div class="col-md-8 col-md-offset-2"> <h2 class=text-center>How it works?</h2> <p class="function text-center">"Scala Exercises" brings the popular <a href="http://www.scalakoans.org/">Scala Koans</a> to the web. Offering hundreds of solveable exercises organized into 42 categories covering the basics of the Scala language.</p> </div> </div> </div> <hr> <div class=step> <div class=row> <div class="col-md-8 col-md-offset-2 step-content"> <div class=step-icon> <img src=images/9b7ab054.step_012x.png alt="Learn: Each category includes an explanation of the basics. Learn the concepts through simple code samples."> </div> <div class=step-text> <h3>Learn</h3> <p>Each category includes an explanation of the basics. Learn the concepts through simple code samples.</p> </div> </div> </div> <div class=row> <div class="col-md-8 col-md-offset-2 step-content"> <div class=step-icon> <img src=images/6802006a.step_022x.png alt="Solve: Each exercise is a unit test that must pass successfully, complete the exercise by filling in the blanks. Receive instant feedback as your answers are validated in real-time."> </div> <div class=step-text> <h3>Solve</h3> <p>Each exercise is a unit test that must pass successfully, complete the exercise by filling in the blanks. Receive instant feedback as your answers are validated in real-time.</p> </div> </div> </div> <div class=row> <div class="col-md-8 col-md-offset-2 step-content"> <div class=step-icon> <img src=images/33115d96.step_032x.png alt="Share: The system will consider the category complete when all its exercises are successfully done"> </div> <div class=step-text> <h3>Share</h3> <p>The system will consider the category complete when all its exercises are successfully done. Don't forget to share your progress on social networks before moving on to the next category!</p> </div> </div> </div> <div class=row> <div class="col-md-8 col-md-offset-2 step-content"> <div class=step-icon> <img src=images/f3638223.step_042x.png alt="Edit: After completing a category, you'll be able to go back and edit it"> </div> <div class=step-text> <h3>Edit</h3> <p>After completing a category, you'll be able to go back and edit it. Add new exercises or improve existing ones by sending a pull-request.</p> </div> </div> </div> </div> <div class=row> <div class=divider> <div class="col-md-12 text-center"> <hr> <span> <a href=koans><button type=button class="btn btn-primary btn-lg">Let's Begin!</button></a> </span> </div> </div> </div> </div> </section> <footer id=bottom> <div class=link-content> <div class="content-image content-image-footer"></div> <div class=container> <div class=row> <div class="col-md-4 text-center item"> <a href=https://typesafe.com/resources/e-books target=_blank> <div class="icon-general icon-books"></div> <h3>Books</h3> <p>Deepen your knowledge of Scala with this collection of books recommended by Typesafe.</p> </a> </div> <div class="col-md-4 text-center item"> <a href="http://docs.scala-lang.org/" target=_blank> <div class="icon-general icon-official-docs"></div> <h3>Official Docs</h3> <p>Access community-driven documentation for Scala including guides, tutorials and a glossary.</p> </a> </div> <div class="col-md-4 text-center item"> <a href=http://www.47deg.com/blog/tags/scala target=_blank> <div class="icon-general icon-blog"></div> <h3>Blog</h3> <p>At 47 Degrees we occasionally write about Scala on our blog. Take a look!</p> </a> </div> </div> </div> </div> <div class="spread text-center"> <div class=container> <button type=button class="btn btn-primary btn-lg" data-toggle=modal data-target=#spreadModal>Spread the word</button> </div> </div> <div class="about text-center"> <div class=container> <p> <img src=images/df532660.logo_47deg2x.png alt="">Copyright © 2014 - <a href=http://47deg.com>47 Degrees</a> <br> Reactive, scalable software solutions. All rights reserved. <br> Scala Koans Copyright © <a href=http://scalakoans.org>Scala Koans</a> - All Rights Reserved </p> </div> </div> </footer> <!-- modal start --> <div class="modal fade" id=spreadModal tabindex=-1 role=dialog aria-labelledby=spreadModalLabel aria-hidden=true> <div class=modal-dialog> <div class=modal-content> <div class=modal-header> <button type=button class=close data-dismiss=modal><span aria-hidden=true>&times;</span><span class=sr-only>Close</span></button> <h4 class=modal-title id=spreadModalLabel>SPREAD THE WORD</h4> </div> <div class=modal-body> <div class=row> <div class="col-sm-8 col-sm-offset-2">Do you think "Scala Exercises" is useful? Share it with your friends. Who knows, maybe you will inspire some future Scala developers.</div> </div> <div class="row share-step"> <div class="col-sm-2 col-sm-offset-3"> <span class="fa-stack fa-lg" onclick=shareSiteFacebook()> <i class="fa fa-circle fa-stack-2x facebook"></i> <i class="fa fa-facebook fa-fw fa-stack-1x fa-inverse"></i> </span> </div> <div class=col-sm-2> <span class="fa-stack fa-lg" onclick=shareSiteTwitter()> <i class="fa fa-circle fa-stack-2x twitter"></i> <i class="fa fa-twitter fa-fw fa-stack-1x fa-inverse"></i> </span> </div> <div class=col-sm-2> <span class="fa-stack fa-lg" onclick=shareSiteGoogle()> <i class="fa fa-circle fa-stack-2x plus"></i> <i class="fa fa-google-plus fa-fw fa-stack-1x fa-inverse"></i> </span> </div> </div> </div> <div class=modal-footer> </div> </div> </div> </div> <!-- modal end --> <script src=scripts/6d2b5497.vendor.js></script> <!-- Google Analytics: change UA-XXXXX-X to be your site's ID. --> <script>(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
3+
<![endif]--> <header id=intro> <div class=content-image></div> <div class="presentation animated fadeInDown"> <h1>Scala Exercises</h1> <p class=lead>The easy way to learn Scala.</p> <p class=lead> <button type=button class="btn btn-primary btn-lg" onclick="moveToDiv('content')">GET STARTED</button> </p> <div id=gitHubLayer> <a target=_blank href=https://github.com/47deg/scala-exercises> <i class="fa fa-github fa-main"></i><br>Contribute </a> <div class=row> <div class=col-xs-4> <a class=gitHubWidget target=_blank href=https://github.com/47deg/scala-exercises/watchers> <h2><i class="fa fa-eye"></i> <span id=eyes>00</span></h2> </a> </div> <div class=col-xs-4> <a class=gitHubWidget target=_blank href=https://github.com/47deg/scala-exercises/stargazers> <h2><i class="fa fa-star"></i> <span id=stars>00</span></h2> </a> </div> <div class=col-xs-4> <a class=gitHubWidget target=_blank href=https://github.com/47deg/scala-exercises/fork> <h2><i class="fa fa-code-fork"></i> <span id=forks>00</span></h2> </a> </div> </div> </div> </div> </header> <section id=content> <div class=container> <div class=introduction> <div class=row> <div class="col-md-8 col-md-offset-2"> <h2 class=text-center>How it works</h2> <p class="function text-center">"Scala Exercises" brings the popular <a href="http://www.scalakoans.org/">Scala Koans</a> to the web. Offering hundreds of solvable exercises organized into 42 categories covering the basics of the Scala language.</p> </div> </div> </div> <hr> <div class=step> <div class=row> <div class="col-md-8 col-md-offset-2 step-content"> <div class=step-icon> <img src=images/9b7ab054.step_012x.png alt="Learn: Each category includes an explanation of the basics. Learn the concepts through simple code samples."> </div> <div class=step-text> <h3>Learn</h3> <p>Each category includes an explanation of the basics. Learn the concepts through simple code samples.</p> </div> </div> </div> <div class=row> <div class="col-md-8 col-md-offset-2 step-content"> <div class=step-icon> <img src=images/6802006a.step_022x.png alt="Solve: Each exercise is a unit test that must pass successfully, complete the exercise by filling in the blanks. Receive instant feedback as your answers are validated in real-time."> </div> <div class=step-text> <h3>Solve</h3> <p>Each exercise is a unit test that must pass successfully, complete the exercise by filling in the blanks. Receive instant feedback as your answers are validated in real-time.</p> </div> </div> </div> <div class=row> <div class="col-md-8 col-md-offset-2 step-content"> <div class=step-icon> <img src=images/33115d96.step_032x.png alt="Share: The system will consider the category complete when all its exercises are successfully done"> </div> <div class=step-text> <h3>Share</h3> <p>The system will consider the category complete when all its exercises are successfully done. Don't forget to share your progress on social networks before moving on to the next category!</p> </div> </div> </div> <div class=row> <div class="col-md-8 col-md-offset-2 step-content"> <div class=step-icon> <img src=images/f3638223.step_042x.png alt="Edit: After completing a category, you'll be able to go back and edit it"> </div> <div class=step-text> <h3>Edit</h3> <p>After completing a category, you'll be able to go back and edit it. Add new exercises or improve existing ones by sending a pull-request.</p> </div> </div> </div> </div> <div class=row> <div class=divider> <div class="col-md-12 text-center"> <hr> <span> <a href=koans><button type=button class="btn btn-primary btn-lg">Let's Begin!</button></a> </span> </div> </div> </div> </div> </section> <footer id=bottom> <div class=link-content> <div class="content-image content-image-footer"></div> <div class=container> <div class=row> <div class="col-md-4 text-center item"> <a href=https://typesafe.com/resources/e-books target=_blank> <div class="icon-general icon-books"></div> <h3>Books</h3> <p>Deepen your knowledge of Scala with this collection of books recommended by Typesafe.</p> </a> </div> <div class="col-md-4 text-center item"> <a href="http://docs.scala-lang.org/" target=_blank> <div class="icon-general icon-official-docs"></div> <h3>Official Docs</h3> <p>Access community-driven documentation for Scala including guides, tutorials and a glossary.</p> </a> </div> <div class="col-md-4 text-center item"> <a href=http://www.47deg.com/blog/tags/scala target=_blank> <div class="icon-general icon-blog"></div> <h3>Blog</h3> <p>At 47 Degrees we occasionally write about Scala on our blog. Take a look!</p> </a> </div> </div> </div> </div> <div class="spread text-center"> <div class=container> <button type=button class="btn btn-primary btn-lg" data-toggle=modal data-target=#spreadModal>Spread the word</button> </div> </div> <div class="about text-center"> <div class=container> <p> <img src=images/df532660.logo_47deg2x.png alt="">Copyright © 2014 - <a href=http://47deg.com>47 Degrees</a> <br> Reactive, scalable software solutions. All rights reserved. <br> Scala Koans Copyright © <a href=http://scalakoans.org>Scala Koans</a> - All Rights Reserved </p> </div> </div> </footer> <!-- modal start --> <div class="modal fade" id=spreadModal tabindex=-1 role=dialog aria-labelledby=spreadModalLabel aria-hidden=true> <div class=modal-dialog> <div class=modal-content> <div class=modal-header> <button type=button class=close data-dismiss=modal><span aria-hidden=true>&times;</span><span class=sr-only>Close</span></button> <h4 class=modal-title id=spreadModalLabel>SPREAD THE WORD</h4> </div> <div class=modal-body> <div class=row> <div class="col-sm-8 col-sm-offset-2">Do you think "Scala Exercises" is useful? Share it with your friends. Who knows, maybe you will inspire some future Scala developers.</div> </div> <div class="row share-step"> <div class="col-sm-2 col-sm-offset-3"> <span class="fa-stack fa-lg" onclick=shareSiteFacebook()> <i class="fa fa-circle fa-stack-2x facebook"></i> <i class="fa fa-facebook fa-fw fa-stack-1x fa-inverse"></i> </span> </div> <div class=col-sm-2> <span class="fa-stack fa-lg" onclick=shareSiteTwitter()> <i class="fa fa-circle fa-stack-2x twitter"></i> <i class="fa fa-twitter fa-fw fa-stack-1x fa-inverse"></i> </span> </div> <div class=col-sm-2> <span class="fa-stack fa-lg" onclick=shareSiteGoogle()> <i class="fa fa-circle fa-stack-2x plus"></i> <i class="fa fa-google-plus fa-fw fa-stack-1x fa-inverse"></i> </span> </div> </div> </div> <div class=modal-footer> </div> </div> </div> </div> <!-- modal end --> <script src=scripts/6d2b5497.vendor.js></script> <!-- Google Analytics: change UA-XXXXX-X to be your site's ID. --> <script>(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
44
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
55
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
66
})(window,document,'script','//www.google-analytics.com/analytics.js','ga');

dist/json/higherorderfunctions.json

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,11 @@
7575
"List(\"ABC\", \"XYZ\", \"123\")",
7676
"List(\"abc\", \"xyz\", \"123\")",
7777
"List(5, 6, 7)"
78+
],
79+
"alternatives": [
80+
"^List\\( *\"ABC\" *, *\"XYZ\" *, *\"123\" *\\)$",
81+
"^List\\( *\"abc\" *, *\"xyz\" *, *\"123\" *\\)$",
82+
"^List\\( *5 *, *6 *, *7 *\\)$"
7883
],
7984
"postparagraph": ""
8085
},
@@ -94,6 +99,10 @@
9499
"solutions": [
95100
"List(12, 20, 2)",
96101
"List(12, 20, 2)"
102+
],
103+
"alternatives": [
104+
"^List\\( *12 *, *20 *, *2 *\\)$",
105+
"^List\\( *12 *, *20 *, *2 *\\)$"
97106
],
98107
"postparagraph": ""
99108
}

dist/json/partialfunctions.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
"postparagraph": ""
1212
},
1313
{
14-
"preparagraph": "Case statements are a quick way to create partial functions. When you create a case statement, the apply and `isDefinedAt` is created for you.",
14+
"preparagraph": "Case statements are a quick way to create partial functions. When you create a case statement, the `apply` and `isDefinedAt` is created for you.",
1515
"code": "//These case statements are called case statements with guards\nval doubleEvens: PartialFunction[Int, Int] = {\n case x: Int if (x % 2) == 0 => x * 2\n}\nval tripleOdds: PartialFunction[Int, Int] = {\n case x: Int if (x % 2) != 0 => x * 3\n}\n\nval whatToDo = doubleEvens orElse tripleOdds //Here we chain the partial functions together\nwhatToDo(3) should be(__)\nwhatToDo(4) should be(__)",
1616
"solutions": [
1717
"9",

dist/koans.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,4 @@
88
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
99
})(window,document,'script','//www.google-analytics.com/analytics.js','ga');
1010
ga('create', 'UA-18433785-8', 'auto');
11-
ga('send', 'pageview');</script> <script src=scripts/9e766b80.koan.js></script> <!-- include: "type": "js", "files": "scripts/**/*.js" -->
11+
ga('send', 'pageview');</script> <script src=scripts/a116cc3e.koan.js></script> <!-- include: "type": "js", "files": "scripts/**/*.js" -->

0 commit comments

Comments
 (0)