Skip to content
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

My solution #241

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
112 changes: 112 additions & 0 deletions Solutions/MeshachOpoku.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,112 @@
/*Identity Function:Take what is given and return it.It can be string a number or whatever is passed as argument.Happy Coding!*/

identity=(input)=>{
return input;}

identity(3);


/*Identity function in different way*/

identity=(s)=>x;
identity("Hello");



/*Comment:function that add two numbers together*/
addb=(l, b)=> parseInt(l)+parseInt(b);
addb(3,2);

/*Comment:function in different form but add two numbers together*/
add=function(a,b){return parseInt(a)+parseInt(b);}
add(3,5);




/*
```js
module.exports = {
identity,
addb,
subb,
mulb,
minb,
maxb,
add,
sub,
mul,
min,
max,
addRecurse,
mulRecurse,
minRecurse,
maxRecurse,
not,
acc,
accPartial,
accRecurse,
fill,
fillRecurse,
set,
identityf,
addf,
liftf,
pure,
curryb,
curry,
inc,
twiceUnary,
doubl,
square,
twice,
reverseb,
reverse,
composeuTwo,
composeu,
composeb,
composeTwo,
compose,
limitb,
limit,
genFrom,
genTo,
genFromTo,
elementGen,
element,
collect,
filter,
filterTail,
concatTwo,
concat,
concatTail,
gensymf,
gensymff,
fibonaccif,
counter,
revocableb,
revocable,
extract,
m,
addmTwo,
addm,
liftmbM,
liftmb,
liftm,
exp,
expn,
addg,
liftg,
arrayg,
continuizeu,
continuize,
vector,
exploitVector,
vectorSafe,
pubsub,
mapRecurse,
filterRecurse,
};
```

*/
15 changes: 8 additions & 7 deletions Solutions/schmeb0704_solution.js
Original file line number Diff line number Diff line change
@@ -1,30 +1,31 @@
// Write a function twiceUnary that takes a binary function and returns a unary function that passes its argument to the binary function twice
function twiceUnary(binaryFunc, n){
/*function twiceUnary(binaryFunc, n){
function unaryFunc(input){
return binaryFunc(input, input)
function binaryFunc(input, input){;}
return binaryFunc(input, input)
}

return unaryFunc(n)
}
*/

// Use the function twiceUnary to create the doubl function

function doubl(n){
/*function doubl(n){
const times2 = (num1, num2) => num1 + num2

return twiceUnary(times2, n)

}
}*/

// Use the function twiceUnary to create the square function

function square(n){
/*function square(n){
const selfMult = (num1, num2) => num1 * num2

return twiceUnary(selfMult, n)

}

}*/
module.exports = {
// identity,
// addb,
Expand Down
Loading