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

Conditionals, Nested Conditionals, Binary Search (Selection) #27

Open
aliyatang opened this issue Apr 3, 2023 · 0 comments
Open

Conditionals, Nested Conditionals, Binary Search (Selection) #27

aliyatang opened this issue Apr 3, 2023 · 0 comments

Comments

@aliyatang
Copy link
Owner

aliyatang commented Apr 3, 2023

Selection: Lesson Plan

Conditionals and nested conditionals

Allow you to make decisions in your program based on certain conditions

Explain main types of conditional statements:

  • if statements
  • if/else statements
  • elif
  • nested if
  • nested if/else statements

Use in our simulation: Blackjack

  • If sum of cards is more than 21 you break
  • If sum of cards if more than 21 and you have an ace (worth 11) then one ace is worth 1

Example code exercises and homework

Binary Search

Searching algorithm used in a sorted array by repeatedly dividing the search interval in half

Use in our simulation: Blackjack

  • Similar to splitting an ordered deck

Example code exercises and homework

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant