This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const simpleFac = (n) => { | |
if (n === 1) return n | |
return n * simpleFac(n - 1) | |
} | |
const TRFac = (n, a) => { | |
if (n === 0) return a | |
return TRFac(n - 1, a * n) | |
} | |
// hier wird der Stack 5 mal gecallt => was Sinn macht |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
summarizer = (sum) => { | |
if (sum === 0) { | |
return 0; | |
} | |
return sum + summarizer(sum - 1); | |
} | |
console.log(summarizer(100)); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const magicNumber = (range) => { | |
[...Array(range + 1).keys()].map(n => { | |
const res = n**5 - 5*n**3 + 4*n; | |
if (res >= 120 && (res % 120 !== 0)) { | |
return n; | |
} | |
}) | |
return 'no number found'; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React, { useState } from 'react'; | |
const ContactForm = () => { | |
const [newsletterValue, setNewsletterValue] = useState(false); | |
function changeNewsletterValue() { | |
setNewsletterValue(!newsletterValue); | |
} | |
function handleSubmit(event) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React, { useState } from 'react'; | |
const ContactForm = () => { | |
const [newsletterValue, setNewsletterValue] = useState(false); | |
function changeNewsletterValue() { | |
setNewsletterValue(!newsletterValue); | |
} | |
... |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React from 'react'; | |
const ContactForm = () => { | |
function handleSubmit(event) { | |
event.preventDefault(); | |
const data = {}; | |
const formElements = Array.from(event.target); | |
formElements.map(input => (data[input.name] = input.value)); | |
} | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import unittest | |
def bn(draws=None, balls=None): | |
#error message for missing input | |
if draws == None or balls == None: return "Missing Input" | |
#error message for negative input | |
if draws < 0 or balls < 0: return "Input has to be a number >= 0" | |
#error message if draws > balls | |
if balls<draws: return "Input number for draws has to be <= input number for balls" | |
#defining the factorial function |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<html> | |
<head> | |
<meta charset="utf-8"> | |
<title>Free Code Camp - Tic Tac Toe Game</title> | |
<link rel="stylesheet" type="text/css" href="bootstrap.min.css"> | |
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/4.0.0-beta/css/bootstrap.min.css"> | |
<link rel="stylesheet" type="text/css" href="https://ajax.aspnetcdn.com/ajax/jquery.ui/1.8.12/themes/redmond/jquery-ui.css"> | |
<style type="text/css">< | |
body { | |
background-color: white; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="utf-8"> | |
<title>FCC Simon Game</title> | |
<link rel="stylesheet" type="text/css" href="bootstrap.min.css"> | |
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.3.7/css/bootstrap.min.css"> | |
<style type="text/css"> | |
body { | |
background-color: beige; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<html> | |
<head> | |
<meta charset="utf-8"> | |
<title>Twitch.tv - Viewer</title> | |
<link rel="stylesheet" type="text/css" href="bootstrap.min.css"> | |
<link rel="stylesheet" type="text/css" href="bootstrap.min.css"> | |
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css"> | |
<style type="text/css"> | |
<link href="https://fonts.googleapis.com/css?family=Catamaran" rel="stylesheet"> |
NewerOlder