Skip to content

neudabei/crystal_learning_hour

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 

Repository files navigation

Crystal Learning Hour

Crystal - "Fast as C, Slick as Ruby"

"Crystal’s syntax is heavily inspired by Ruby’s, so it feels natural to read and easy to write, and has the added benefit of a lower learning curve for experienced Ruby devs." - https://crystal-lang.org

Compile and run code in Crystal online

https://play.crystal-lang.org/#/cr

Install Crystal

https://crystal-lang.org/docs/installation/

Resources

Exercises

1.) Implement the method equal_to_four(n) and have it return "yep" in the affirmative and "nope" in the opposite case.
$ cd exercises/equal_to_four/
$ crystal spec

2.) Create a Learner object which has a name and can learn and discuss.
$ cd exercises/learner/
$ crystal spec
See how similar OOP in Crystal is to Ruby and what's different.

3.) Solve the exercise Reduce but Grow on Codewars.
See https://crystal-lang.org/api/0.22.0/Enumerable.html#reduce%28%26block%29-instance-method for help with the reduce method.

4.) Write an anagram finder: http://exercism.io/exercises/crystal/anagram/readme
$ cd exercises/anagram_finder/
$ crystal spec
Make use of the exercism.io test suite. See what you would have to change to run the script in Ruby and compare performance with $ time crystal/ruby script.

5.) Build a hello world web app with Kemal, the web framework for Crystal.
http://kemalcr.com/docs/getting_started/

About

Learning hour about the Crystal programming language

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published