-
Notifications
You must be signed in to change notification settings - Fork 14
/
ex00.ex
45 lines (32 loc) · 1.55 KB
/
ex00.ex
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
ExUnit.start
Code.load_file "support.ex"
defmodule Ex00 do
use ExUnit.Case
import Support
##############################################################################
# 1: 1 questions, 0 points available #
##############################################################################
# Rubric (per question): #
# #
# Does it pass tests?. . . . . . . . . . . . . . . . 60% #
# #
# Was is written using the given constraints? Is . . 20% #
# it free of any errors not found by the tests #
# #
# Is it written in a functional, Elixir style? . . . 20% #
##############################################################################
@moduledoc """
All the exercises should be solved using anonymous functions.
You can try your answers first in iex.
You can run the tests on your functions using
elixir ex00.ex
"""
##################
# 0.1: 0 points #
##########################################################
# Write a function that increments its numeric parameter #
##########################################################
inc = your_anonymous_function(1)
assert inc.(2) == 3
assert inc.(-1) == 0
end