-
Notifications
You must be signed in to change notification settings - Fork 32
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
final #32
base: master
Are you sure you want to change the base?
final #32
Conversation
I've graded this so you can see any comments, but it'll be a zero in canvas. |
@@ -36,7 +36,7 @@ defmodule Ex01 do | |||
# Write a function that adds two numbers using fn syntax # | |||
########################################################## | |||
|
|||
sum2a = your_anonymous_function(1, 2) | |||
sum2a = fn (a, b) -> a + b end |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
5
@@ -47,7 +47,7 @@ defmodule Ex01 do | |||
# Write a function that adds two numbers using & syntax # | |||
########################################################## | |||
|
|||
sum2b = your_anonymous_function(1, 2) | |||
sum2b = &(&1 + &2) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
5
@@ -60,7 +60,7 @@ defmodule Ex01 do | |||
# no explicit + operators in your function # | |||
##################################################################### | |||
|
|||
sum3a = your_anonymous_function(1, 2, 3) | |||
sum3a = fn (a,b,c) -> sum2a.(a, sum2a.(b,c)) end |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
5
@@ -71,7 +71,7 @@ defmodule Ex01 do | |||
# Do the same using the & notation # | |||
#################################### | |||
|
|||
sum3b = your_anonymous_function | |||
sum3b = &(sum2a.(&1, sum2a.(&2,&3))) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
5
@@ -86,7 +86,7 @@ defmodule Ex01 do | |||
# function. The examples below will make this clearer :) # | |||
######################################################################## | |||
|
|||
create_adder = your_anonymous_function(1) | |||
create_adder = fn(a) -> fn(b) -> a+b end end |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
10
@@ -101,7 +115,10 @@ defmodule Ex03 do | |||
|
|||
""" | |||
|
|||
def list_equal . . . "your code" | |||
def list_equal(list1, list2) do |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
0
"However, let's assume that ==
doesn't work for lists."
@@ -149,7 +166,31 @@ defmodule Ex03 do | |||
Think a little about a nice way to lay this code out. | |||
""" | |||
|
|||
def won . . . "your code" | |||
def won(tup)do |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
4
Good. But why convert to lists?
@@ -39,7 +39,9 @@ defmodule Ex04 do | |||
[ 1, 2, 3, 4, 5 ] | |||
|
|||
""" | |||
def reverse . . . "your code" | |||
def reverse(list) do |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
5
@@ -55,7 +57,9 @@ defmodule Ex04 do | |||
|
|||
""" | |||
|
|||
def min . . . "your code" | |||
def min(list)do |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
5
@@ -75,8 +79,9 @@ defmodule Ex04 do | |||
return value will be the thing you have to manipulate. | |||
""" | |||
|
|||
def even_odd . . . "your code" | |||
|
|||
def even_odd(list) do |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
0
Smart, but no library functions...
Radhika Dharulkar
46911479