kandi background
Explore Kits

Poker | Fully functional Pokerbot that works on PartyPoker | Machine Learning library

 by   dickreuter Python Version: latest License: No License

 by   dickreuter Python Version: latest License: No License

Download this library from

kandi X-RAY | Poker Summary

Poker is a Python library typically used in Artificial Intelligence, Machine Learning applications. Poker has no vulnerabilities, it has build file available and it has medium support. However Poker has 4 bugs. You can download it from GitHub.
Fully functional Pokerbot that works on PartyPoker, PokerStars and GGPoker, scraping tables with Open-CV (adaptable via gui) or neural network and making decisions based on a genetic algorithm and montecarlo simulation for poker equity calculation. Binaries can be downloaded with this link:
Support
Support
Quality
Quality
Security
Security
License
License
Reuse
Reuse

kandi-support Support

  • Poker has a medium active ecosystem.
  • It has 930 star(s) with 284 fork(s). There are 130 watchers for this library.
  • It had no major release in the last 12 months.
  • There are 0 open issues and 84 have been closed. On average issues are closed in 47 days. There are 1 open pull requests and 0 closed requests.
  • It has a neutral sentiment in the developer community.
  • The latest version of Poker is latest
Poker Support
Best in #Machine Learning
Average in #Machine Learning
Poker Support
Best in #Machine Learning
Average in #Machine Learning

quality kandi Quality

  • Poker has 4 bugs (1 blocker, 0 critical, 3 major, 0 minor) and 949 code smells.
Poker Quality
Best in #Machine Learning
Average in #Machine Learning
Poker Quality
Best in #Machine Learning
Average in #Machine Learning

securitySecurity

  • Poker has no vulnerabilities reported, and its dependent libraries have no vulnerabilities reported.
  • Poker code analysis shows 0 unresolved vulnerabilities.
  • There are 2 security hotspots that need review.
Poker Security
Best in #Machine Learning
Average in #Machine Learning
Poker Security
Best in #Machine Learning
Average in #Machine Learning

license License

  • Poker does not have a standard license declared.
  • Check the repository for any license declaration and review the terms closely.
  • Without a license, all rights are reserved, and you cannot use the library in your applications.
Poker License
Best in #Machine Learning
Average in #Machine Learning
Poker License
Best in #Machine Learning
Average in #Machine Learning

buildReuse

  • Poker releases are available to install and integrate.
  • Build file is available. You can build the component from source.
  • Poker saves you 6378 person hours of effort in developing the same functionality from scratch.
  • It has 13269 lines of code, 580 functions and 70 files.
  • It has high code complexity. Code complexity directly impacts maintainability of the code.
Poker Reuse
Best in #Machine Learning
Average in #Machine Learning
Poker Reuse
Best in #Machine Learning
Average in #Machine Learning
Top functions reviewed by kandi - BETA

kandi has reviewed Poker and discovered the below as its top functions. This is intended to give you an instant insight into Poker implemented functionality, and help decide if they suit your requirements.

  • Run the game
    • Run Montecarlo
    • Determine the winner of the game
    • Performs the decision based on the preflop table
    • Update the values of the game
  • Improve the strategy
    • Assigns bet
    • Assigns the rule for a given stage
    • Modify the selected strategy
  • Draws a stacked figure
    • Run montecarlo
      • Get the straight draw of the deck
        • Run the bot
          • Draw figure
            • The scroll event handler
              • Open the setup dialog
                • Opens the strategy editor
                  • Opens the strategy
                    • Write a log file
                      • Wrapper for multiprocessing
                        • Memory cache decorator
                          • Run the event loop
                            • Sets the value of an attribute on the object
                              • Action handler
                                • Call genetic algorithm
                                  • Get the open straight draw of the deck
                                    • Calculates the straight draw for the given board

                                      Get all kandi verified functions for this library.

                                      Get all kandi verified functions for this library.

                                      Poker Key Features

                                      Fully functional Pokerbot that works on PartyPoker, PokerStars and GGPoker, scraping tables with Open-CV (adaptable via gui) or neural network and making decisions based on a genetic algorithm and montecarlo simulation for poker equity calculation. Binaries can be downloaded with this link:

                                      Poker Examples and Code Snippets

                                      See all related Code Snippets

                                      Video Poker How to make the combinations?

                                      copy iconCopydownload iconDownload
                                      let numberList = [];
                                      
                                      numberList += num
                                      
                                      numberList.push(num)
                                      
                                      // Full house
                                          for (i = 0; i < 5; i++){
                                            possible = 0;
                                            let selected = numberList[i];
                                            if (countObjects(numberList, selected) == 3){
                                              possible += 1;
                                            }
                                            if (countObjects(numberList, selected) == 2){
                                              possible += 1;
                                            }
                                          }
                                          if (possible == 2){
                                            winScreen("Full House!");
                                          }
                                      
                                      let numberList = [];
                                      
                                      numberList += num
                                      
                                      numberList.push(num)
                                      
                                      // Full house
                                          for (i = 0; i < 5; i++){
                                            possible = 0;
                                            let selected = numberList[i];
                                            if (countObjects(numberList, selected) == 3){
                                              possible += 1;
                                            }
                                            if (countObjects(numberList, selected) == 2){
                                              possible += 1;
                                            }
                                          }
                                          if (possible == 2){
                                            winScreen("Full House!");
                                          }
                                      
                                      let numberList = [];
                                      
                                      numberList += num
                                      
                                      numberList.push(num)
                                      
                                      // Full house
                                          for (i = 0; i < 5; i++){
                                            possible = 0;
                                            let selected = numberList[i];
                                            if (countObjects(numberList, selected) == 3){
                                              possible += 1;
                                            }
                                            if (countObjects(numberList, selected) == 2){
                                              possible += 1;
                                            }
                                          }
                                          if (possible == 2){
                                            winScreen("Full House!");
                                          }
                                      
                                      let numberList = [];
                                      
                                      numberList += num
                                      
                                      numberList.push(num)
                                      
                                      // Full house
                                          for (i = 0; i < 5; i++){
                                            possible = 0;
                                            let selected = numberList[i];
                                            if (countObjects(numberList, selected) == 3){
                                              possible += 1;
                                            }
                                            if (countObjects(numberList, selected) == 2){
                                              possible += 1;
                                            }
                                          }
                                          if (possible == 2){
                                            winScreen("Full House!");
                                          }
                                      
                                          // Full house
                                          possible = 0;
                                          for (i = 0; i < 5; i++){
                                              let selected = numberList[i];
                                              if (countObjects(numberList, selected) == 3){
                                                  possible += 1;
                                              }
                                          }
                                          for (i = 0; i < 5; i++){
                                              if (countObjects(numberList, selected) == 2){
                                                      possible += 1;
                                              }
                                          }
                                          if (possible == 5){
                                              winScreen("Full House!");
                                          }
                                      

                                      How to create global state with React Hooks [TypeScript]

                                      copy iconCopydownload iconDownload
                                      ReactDOM.render(
                                        <React.StrictMode>
                                          <App />
                                        </React.StrictMode>,
                                        document.getElementById('root')
                                      );
                                      
                                      ReactDOM.render(
                                        <React.StrictMode>
                                          <Context.Provider value={[state, dispatch]}>
                                            <App />
                                          </Context.Provider>
                                        </React.StrictMode>,
                                        document.getElementById('root')
                                      );
                                      
                                      
                                      ReactDOM.render(
                                        <React.StrictMode>
                                          <App />
                                        </React.StrictMode>,
                                        document.getElementById('root')
                                      );
                                      
                                      ReactDOM.render(
                                        <React.StrictMode>
                                          <Context.Provider value={[state, dispatch]}>
                                            <App />
                                          </Context.Provider>
                                        </React.StrictMode>,
                                        document.getElementById('root')
                                      );
                                      
                                      
                                      export const Context = createContext<[IStateTypes, Dispatch<any>]>([
                                        initialState,
                                        () => {}
                                      ]);
                                      
                                      export const Store: FC = ({ children }) => {
                                        const [state, dispatch] = useReducer(reducer, initialState);
                                      
                                        return (
                                          <Context.Provider value={[state, dispatch]}>{children}</Context.Provider>
                                        );
                                      };
                                      
                                      import { Store } from "./Store";
                                      
                                      ReactDOM.render(
                                        <React.StrictMode>
                                          <Store>
                                            <App />
                                          </Store>
                                        </React.StrictMode>,
                                        document.getElementById("root")
                                      );
                                      
                                      export const Context = createContext<[IStateTypes, Dispatch<any>]>([
                                        initialState,
                                        () => {}
                                      ]);
                                      
                                      export const Store: FC = ({ children }) => {
                                        const [state, dispatch] = useReducer(reducer, initialState);
                                      
                                        return (
                                          <Context.Provider value={[state, dispatch]}>{children}</Context.Provider>
                                        );
                                      };
                                      
                                      import { Store } from "./Store";
                                      
                                      ReactDOM.render(
                                        <React.StrictMode>
                                          <Store>
                                            <App />
                                          </Store>
                                        </React.StrictMode>,
                                        document.getElementById("root")
                                      );
                                      

                                      How to generate 2,598,960 hands (efficient way) for poker game

                                      copy iconCopydownload iconDownload
                                      1,2,3
                                      1,2,4
                                      1,2,5
                                      1,3,4
                                      1,3,5
                                      1,4,5
                                      2,3,4
                                      2,3,5
                                      2,4,5
                                      3,4,5
                                      
                                      std::vector<std::vector<int>> all_options;
                                      
                                      int factorial(int x)
                                      {
                                          int total = 1;
                                          for(int i = 1; i <= x; i++)
                                              total *= i;
                                          return total;
                                      }
                                      
                                      int combination(int total, int x)
                                      {
                                          return factorial(total) / (factorial(total-x) * factorial(x));
                                      }
                                      
                                      void _recursive_combination(int min, int max, int current_depth, int max_depth, std::vector<int> &previous_values)
                                      {
                                          for(int i = min; i <= max; ++i) {
                                              previous_values.push_back(i);
                                              if( current_depth == max_depth )
                                                  all_options.push_back(previous_values);
                                              else
                                                  _recursive_combination(i + 1, max + 1, current_depth + 1, max_depth, previous_values);
                                              previous_values.pop_back();
                                          }
                                      }
                                      
                                      // depth starts at 1, not 0.
                                      void initialize_combinations(int min, int max, int depth)
                                      {
                                          // Be carefull! 52! is too big.
                                          // int total_combinations = combination(max - min + 1, depth) Doesn't work as 52! is too high.
                                          // all_options.reserve(total_combinations);
                                      
                                          std::vector<int> buffer;
                                          buffer.reserve(depth);
                                      
                                          _recursive_combination(min, max - depth + 1, 1, depth, buffer);
                                      }
                                      
                                      void print_combinations()
                                      {
                                          for(auto &row : all_options){
                                              for(auto col : row)
                                                  std::cout << " " << col;
                                              std::cout << "\n";
                                          }
                                      }
                                      
                                      int main()
                                      {
                                          int cards_per_hand = 5;
                                      
                                          auto start = std::chrono::system_clock::now();
                                          initialize_combinations(1, 52, cards_per_hand);
                                          std::chrono::milliseconds duration = std::chrono::duration_cast<std::chrono::milliseconds>(std::chrono::system_clock::now() - start);
                                      
                                          // print_combinations(); // Be carefull, this will make you wait for an eternity.
                                          std::cout << "\n\nSize: " << std::size(all_options);
                                          std::cout << "\nTime: " << duration;
                                          std::cout << std::endl;
                                      
                                          return 0;
                                      }
                                      
                                      1,2,3
                                      1,2,4
                                      1,2,5
                                      1,3,4
                                      1,3,5
                                      1,4,5
                                      2,3,4
                                      2,3,5
                                      2,4,5
                                      3,4,5
                                      
                                      std::vector<std::vector<int>> all_options;
                                      
                                      int factorial(int x)
                                      {
                                          int total = 1;
                                          for(int i = 1; i <= x; i++)
                                              total *= i;
                                          return total;
                                      }
                                      
                                      int combination(int total, int x)
                                      {
                                          return factorial(total) / (factorial(total-x) * factorial(x));
                                      }
                                      
                                      void _recursive_combination(int min, int max, int current_depth, int max_depth, std::vector<int> &previous_values)
                                      {
                                          for(int i = min; i <= max; ++i) {
                                              previous_values.push_back(i);
                                              if( current_depth == max_depth )
                                                  all_options.push_back(previous_values);
                                              else
                                                  _recursive_combination(i + 1, max + 1, current_depth + 1, max_depth, previous_values);
                                              previous_values.pop_back();
                                          }
                                      }
                                      
                                      // depth starts at 1, not 0.
                                      void initialize_combinations(int min, int max, int depth)
                                      {
                                          // Be carefull! 52! is too big.
                                          // int total_combinations = combination(max - min + 1, depth) Doesn't work as 52! is too high.
                                          // all_options.reserve(total_combinations);
                                      
                                          std::vector<int> buffer;
                                          buffer.reserve(depth);
                                      
                                          _recursive_combination(min, max - depth + 1, 1, depth, buffer);
                                      }
                                      
                                      void print_combinations()
                                      {
                                          for(auto &row : all_options){
                                              for(auto col : row)
                                                  std::cout << " " << col;
                                              std::cout << "\n";
                                          }
                                      }
                                      
                                      int main()
                                      {
                                          int cards_per_hand = 5;
                                      
                                          auto start = std::chrono::system_clock::now();
                                          initialize_combinations(1, 52, cards_per_hand);
                                          std::chrono::milliseconds duration = std::chrono::duration_cast<std::chrono::milliseconds>(std::chrono::system_clock::now() - start);
                                      
                                          // print_combinations(); // Be carefull, this will make you wait for an eternity.
                                          std::cout << "\n\nSize: " << std::size(all_options);
                                          std::cout << "\nTime: " << duration;
                                          std::cout << std::endl;
                                      
                                          return 0;
                                      }
                                      
                                      for (int i0 = 0; i0 != 48; i0++)
                                          for (int i1 = i0 + 1; i1 != 49; i1++)
                                              for (int i2 = i1 + 1; i2 != 50; i2++)
                                                  for (int i3 = i2 + 1; i3 != 51; i3++)
                                                      for (int i4 = i3 + 1; i4 != 52; i4++)
                                                          store(i0, i1, i2, i3, i4);
                                      

                                      How do you add a fixed sidebar inside an HTML/CSS Grid?

                                      copy iconCopydownload iconDownload
                                      height: 100%;
                                      position: fixed;
                                      
                                      width: 50%;
                                      position: absolute;
                                      right: 0;
                                      
                                      z-index: 1
                                      
                                       * {
                                        margin: 0;
                                      
                                        box-sizing: border-box;
                                      }
                                      
                                      /* The grid container */
                                      .grid-container {
                                        height: 100vh;
                                        display: grid;
                                        grid-template-areas: 
                                          'left right' 
                                          'footer right';
                                      } 
                                      
                                      .grid-item {
                                      
                                              }
                                      
                                              .left { 
                                                  /*grid-area: left;*/
                                                  height: 100%;
                                            position: fixed;
                                            padding-top: 100px;
                                            padding-left: 20px;
                                            padding-right: 20px;
                                            padding-bottom: 20px;
                                            background-color: #ccc;
                                            max-width: 45em;
                                            word-wrap: break-word;
                                              }
                                      
                                          #welcomemessagep {
                                            font-family: century gothic, sans-serif;
                                            color: white;
                                            font-size: 20px;
                                            padding: 20px;
                                          }
                                      
                                          .searchbar {
                                            padding: 20px;
                                            width: 100%;
                                            display: inline-flex;
                                            justify-content: center;
                                      
                                          }
                                      
                                          .searchbarinput {
                                            flex: grow 1;
                                            padding: 10px;
                                            outline: none;
                                            border: 1px solid purple;
                                            border-radius: 5px 0 0 5px;
                                            background: white;
                                            transition: background 0.25s, box-shadow 0.25s;
                                            width: 75%;
                                            height: 5vh;
                                          }
                                      
                                          .searchbarinput:focus {
                                            background: white;
                                            box-shadow: 0 0 2px purple;
                                          }
                                      
                                          .searchbarinput::placeholder {
                                            color: purple;
                                          }
                                      
                                          .searchbarbutton {
                                            width: 40px;
                                            background: purple;
                                            color: white;
                                            outline: none;
                                            border: none;
                                            display: flex;
                                            align-items: center;
                                            justify-content: center;
                                            border-radius: 0 5px 5px 0;
                                            cursor: pointer;
                                            user-select: none;
                                          }
                                      
                                          .searchbarbutton:active {
                                            box-shadow: inset 0 0 30px rgba(0, 0, 0, 0.25);
                                          }
                                      
                                      
                                              .right {
                                                  grid-area: right;
                                            padding-top: 100px;
                                            grid-template-areas: 
                                            'announcements'
                                            'hero'
                                            'blurb'
                                            'articles';
                                            background-color: black;
                                            width: 50%;
                                            position: absolute;
                                            right: 0;
                                              }
                                      
                                          #announcements-text {
                                            font-family: century gothic, sans-serif;
                                            color: red;
                                            padding: 20px;
                                            font-size: 20px;
                                            padding: 20px;
                                          }
                                      
                                          #hero {
                                            background-image: url("images/horse.jpg");
                                            height: 100vh;
                                            width: 100%;
                                          }
                                      
                                          #blurb-text {
                                            font-family: century gothic, sans-serif;
                                            color: white;
                                            font-size: 40px;
                                            padding: 20px;
                                          }
                                      
                                          .articles {
                                            font-family: century gothic, sans-serif;
                                            color: white;
                                            font-size: 40px;
                                            padding: 20px;
                                          }
                                      
                                          #articles-text {
                                            font-family: century gothic, sans-serif;
                                            color: white;
                                            font-size: 40px;
                                            padding-bottom: 20px;
                                            padding-left: 10px;
                                          }
                                      
                                          #article1, #article2, #article3, #article4, #article5, #article6, #article7, #article8, #article9, #article10 {
                                            border: 3px solid white;
                                            color: white;
                                            padding: 10px;
                                          }
                                      
                                          #article1:hover, #article2:hover, #article3:hover, #article4:hover, #article5:hover, #article6:hover, #article7:hover, #article8:hover, #article9:hover, #article10:hover {
                                            background-color: purple;
                                          }
                                      
                                      
                                      
                                          a:link {
                                            text-decoration: none;
                                            color: black;
                                          }
                                      
                                          a:visited {
                                            color: black;
                                          }
                                      
                                          a:active {
                                            color: black;
                                          }
                                      
                                              .footer{
                                                  grid-area: footer;  
                                            background-color: #ccc;
                                          }
                                      
                                      .navbar {
                                        font-family: century gothic, sans-serif;
                                        background-color: #333;
                                        position: fixed;
                                        top: 0;
                                        width: 100%;
                                        display: flex;
                                        justify-content: center;
                                        transition: top 0.3s;
                                        padding: 20px;
                                        z-index: 1;
                                      }       
                                      
                                      .navbar a {
                                        float: left;
                                        display: block;
                                        color: white;
                                        text-align: center;
                                        padding: 15px;
                                        text-decoration: none;
                                      }
                                      
                                      .navbar a:hover {
                                        text-decoration: underline;
                                        text-underline-offset: 8px;
                                      }
                                      
                                      .cards {
                                        height: 20vh;
                                        display: grid;
                                          grid-template-areas: 
                                          'membership-card facebook-card' 
                                          'donate-card rentals-card';
                                        gap: 2em;
                                        padding: 30px;
                                      }
                                      
                                      #membership-card, #facebook-card, #donate-card, #rentals-card  {
                                        text-align: center;
                                        font-size: 20px;
                                        font-weight: bold;
                                        padding: 20px;
                                        box-shadow: 0 4px 8px 0 rgba(0,0,0,0.2);
                                        transition: 0.3s;
                                        border-radius: 5px; 
                                      }
                                      
                                      #membership-card:hover, #facebook-card:hover, #donate-card:hover, #rentals-card:hover  {
                                        box-shadow: 0 16px 32px 0 rgba(0,0,0,0.2);
                                      }
                                      
                                      .container {
                                        padding: 2px 16px;
                                        }
                                      
                                      #iconsize {
                                        font-size: 50px;
                                        color: purple;
                                      }
                                      
                                      #smallblurbs {
                                        text-align: center;
                                        font-size: 15px;
                                        font-weight: normal;
                                      }
                                      
                                      p {
                                        font-size: 40px;
                                      }
                                      <!DOCTYPE html>
                                      <html lang="en">
                                      
                                      <head>
                                        <meta charset="utf-8">
                                        <title>Elk Beaver Lake Equestrian Society</title>
                                        <meta name="viewport" content="width=device-width, initial-scale=1">
                                        <link rel="stylesheet" href="style.css">
                                        <link rel="stylesheet" href="https://fonts.googleapis.com/icon?family=Material+Icons">
                                      </head>
                                      
                                      <body>
                                      
                                        <div class="navbar" id="navbar">
                                          <a href="#home">Home</a>
                                          <a href="#membership">Membership</a>
                                          <a href="#facilities">Facilities</a>
                                          <a href="#trails">Trails</a>
                                          <a href="#aboutus">About Us</a>
                                          <a href="https://www.facebook.com/parkridersunited/">Facebook</a>
                                        </div>
                                      
                                        <div class="grid-container">
                                      
                                          <div class="grid-item left">
                                            <form action="index.html" method="get">
                                              <div id="welcomemessage">
                                                <p id="welcomemessagep"> Welcome to EBLES! EBLES promotes sensible riding in Elk/Beaver Lake Park so that the equestrian community can co-exist with all users of the park. The community rings remain in existence because EBLES and our members maintain it for the use
                                                  of everyone.</p>
                                              </div>
                                              <div class="searchbar">
                                                <input type="text" class="searchbarinput" name="search" placeholder="Search the Website!">
                                                <button type="submit" class="searchbarbutton"> 
                                                  <i class="material-icons">search</i>
                                                </button>
                                              </div>
                                            </form>
                                      
                                            <div class="cards">
                                              <a href="membership.html">
                                                <div id="membership-card">
                                                  <i class="material-icons" id="iconsize">people</i>
                                                  <div class="container">
                                                    <p>Membership</p>
                                                    <p id=smallblurbs>Buy your 2021 membership!</p>
                                                  </div>
                                                </div>
                                              </a>
                                      
                                              <a href="https://www.facebook.com/parkridersunited/">
                                                <div id="facebook-card">
                                                  <i class="material-icons" id="iconsize">facebook</i>
                                                  <div class="container">
                                                    <p>Facebook</p>
                                                    <p id=smallblurbs>Join our community!</p>
                                                  </div>
                                                </div>
                                              </a>
                                      
                                              <a href="aboutus.html">
                                                <div id="donate-card">
                                                  <i class="material-icons" id="iconsize">savings</i>
                                                  <div class="container">
                                                    <p>Donate</p>
                                                    <p id=smallblurbs>Help support local riders!</p>
                                                  </div>
                                                </div>
                                              </a>
                                      
                                              <a href="facilities.html">
                                                <div id="rentals-card">
                                                  <i class="material-icons" id="iconsize">bedroom_baby</i>
                                                  <div class="container">
                                                    <p>Rentals</p>
                                                    <p id=smallblurbs>Want to ride? Give rentals a try!</p>
                                                  </div>
                                                </div>
                                              </a>
                                      
                                            </div>
                                      
                                      
                                          </div>
                                      
                                      
                                          <div class="grid-item footer">
                                            footer
                                          </div>
                                      
                                      
                                      
                                          <div class="grid-item right">
                                            <div id="announcements">
                                              <p id=announcements-text> Following recommendations by HCBC and Equine Canada, the 2020 EBLES Annual Poker Ride and Trail Class is postponed. Click here for more info! </p>
                                            </div>
                                            <div id="hero">
                                            </div>
                                            <div id="blurb">
                                              <p id=blurb-text> Horses are amazing. People who ride them are too. Join us today. </p>
                                            </div>
                                      
                                            <br>
                                      
                                            <div class="articles">
                                              <p id=articles-text> Here's some articles for you to read: </p>
                                              <a href="https://ebles.org/files/eblesminutesdec2020.pdf">
                                                <div id="article1"> May 3, 2021 - May 2021 Minutes </p>
                                                </div>
                                              </a>
                                              <div id="article2">
                                                <p> April 6, 2021 - April 2021 Minutes </p>
                                              </div>
                                              <div id="article3">
                                                <p> April 1, 2021 - New Baby Horse is Born!</p>
                                              </div>
                                              <div id="article4">
                                                <p> March 24, 2021 - New COVID-19 Updates </p>
                                              </div>
                                              <div id="article5">
                                                <p> March 2, 2021 - March 2021 Minutes </p>
                                              </div>
                                              <div id="article6">
                                                <p> February 8, 2021 - February 2021 Minutes </p>
                                              </div>
                                              <div id="article7">
                                                <p> January 9, 2021 - January 2021 Minutes </p>
                                              </div>
                                              <div id="article8">
                                                <p> January 1, 2021 - Happy New Year! </p>
                                              </div>
                                              <div id="article9">
                                                <p> December 25, 2020 - Merry Christmas to All! Stay safe! </p>
                                              </div>
                                              <div id="article10">
                                                <p> December 4, 2020 - December 2020 Minutes </p>
                                              </div>
                                            </div>
                                      
                                      
                                      
                                      
                                          </div>
                                        </div>
                                      
                                        <script>
                                          var prevScrollpos = window.pageYOffset;
                                          window.onscroll = function() {
                                            var currentScrollPos = window.pageYOffset;
                                            if (prevScrollpos > currentScrollPos) {
                                              document.getElementById("navbar").style.top = "0";
                                            } else {
                                              document.getElementById("navbar").style.top = "-20%";
                                            }
                                            prevScrollpos = currentScrollPos;
                                          }
                                        </script>
                                      
                                      
                                      </body>
                                      
                                      </html>
                                      height: 100%;
                                      position: fixed;
                                      
                                      width: 50%;
                                      position: absolute;
                                      right: 0;
                                      
                                      z-index: 1
                                      
                                       * {
                                        margin: 0;
                                      
                                        box-sizing: border-box;
                                      }
                                      
                                      /* The grid container */
                                      .grid-container {
                                        height: 100vh;
                                        display: grid;
                                        grid-template-areas: 
                                          'left right' 
                                          'footer right';
                                      } 
                                      
                                      .grid-item {
                                      
                                              }
                                      
                                              .left { 
                                                  /*grid-area: left;*/
                                                  height: 100%;
                                            position: fixed;
                                            padding-top: 100px;
                                            padding-left: 20px;
                                            padding-right: 20px;
                                            padding-bottom: 20px;
                                            background-color: #ccc;
                                            max-width: 45em;
                                            word-wrap: break-word;
                                              }
                                      
                                          #welcomemessagep {
                                            font-family: century gothic, sans-serif;
                                            color: white;
                                            font-size: 20px;
                                            padding: 20px;
                                          }
                                      
                                          .searchbar {
                                            padding: 20px;
                                            width: 100%;
                                            display: inline-flex;
                                            justify-content: center;
                                      
                                          }
                                      
                                          .searchbarinput {
                                            flex: grow 1;
                                            padding: 10px;
                                            outline: none;
                                            border: 1px solid purple;
                                            border-radius: 5px 0 0 5px;
                                            background: white;
                                            transition: background 0.25s, box-shadow 0.25s;
                                            width: 75%;
                                            height: 5vh;
                                          }
                                      
                                          .searchbarinput:focus {
                                            background: white;
                                            box-shadow: 0 0 2px purple;
                                          }
                                      
                                          .searchbarinput::placeholder {
                                            color: purple;
                                          }
                                      
                                          .searchbarbutton {
                                            width: 40px;
                                            background: purple;
                                            color: white;
                                            outline: none;
                                            border: none;
                                            display: flex;
                                            align-items: center;
                                            justify-content: center;
                                            border-radius: 0 5px 5px 0;
                                            cursor: pointer;
                                            user-select: none;
                                          }
                                      
                                          .searchbarbutton:active {
                                            box-shadow: inset 0 0 30px rgba(0, 0, 0, 0.25);
                                          }
                                      
                                      
                                              .right {
                                                  grid-area: right;
                                            padding-top: 100px;
                                            grid-template-areas: 
                                            'announcements'
                                            'hero'
                                            'blurb'
                                            'articles';
                                            background-color: black;
                                            width: 50%;
                                            position: absolute;
                                            right: 0;
                                              }
                                      
                                          #announcements-text {
                                            font-family: century gothic, sans-serif;
                                            color: red;
                                            padding: 20px;
                                            font-size: 20px;
                                            padding: 20px;
                                          }
                                      
                                          #hero {
                                            background-image: url("images/horse.jpg");
                                            height: 100vh;
                                            width: 100%;
                                          }
                                      
                                          #blurb-text {
                                            font-family: century gothic, sans-serif;
                                            color: white;
                                            font-size: 40px;
                                            padding: 20px;
                                          }
                                      
                                          .articles {
                                            font-family: century gothic, sans-serif;
                                            color: white;
                                            font-size: 40px;
                                            padding: 20px;
                                          }
                                      
                                          #articles-text {
                                            font-family: century gothic, sans-serif;
                                            color: white;
                                            font-size: 40px;
                                            padding-bottom: 20px;
                                            padding-left: 10px;
                                          }
                                      
                                          #article1, #article2, #article3, #article4, #article5, #article6, #article7, #article8, #article9, #article10 {
                                            border: 3px solid white;
                                            color: white;
                                            padding: 10px;
                                          }
                                      
                                          #article1:hover, #article2:hover, #article3:hover, #article4:hover, #article5:hover, #article6:hover, #article7:hover, #article8:hover, #article9:hover, #article10:hover {
                                            background-color: purple;
                                          }
                                      
                                      
                                      
                                          a:link {
                                            text-decoration: none;
                                            color: black;
                                          }
                                      
                                          a:visited {
                                            color: black;
                                          }
                                      
                                          a:active {
                                            color: black;
                                          }
                                      
                                              .footer{
                                                  grid-area: footer;  
                                            background-color: #ccc;
                                          }
                                      
                                      .navbar {
                                        font-family: century gothic, sans-serif;
                                        background-color: #333;
                                        position: fixed;
                                        top: 0;
                                        width: 100%;
                                        display: flex;
                                        justify-content: center;
                                        transition: top 0.3s;
                                        padding: 20px;
                                        z-index: 1;
                                      }       
                                      
                                      .navbar a {
                                        float: left;
                                        display: block;
                                        color: white;
                                        text-align: center;
                                        padding: 15px;
                                        text-decoration: none;
                                      }
                                      
                                      .navbar a:hover {
                                        text-decoration: underline;
                                        text-underline-offset: 8px;
                                      }
                                      
                                      .cards {
                                        height: 20vh;
                                        display: grid;
                                          grid-template-areas: 
                                          'membership-card facebook-card' 
                                          'donate-card rentals-card';
                                        gap: 2em;
                                        padding: 30px;
                                      }
                                      
                                      #membership-card, #facebook-card, #donate-card, #rentals-card  {
                                        text-align: center;
                                        font-size: 20px;
                                        font-weight: bold;
                                        padding: 20px;
                                        box-shadow: 0 4px 8px 0 rgba(0,0,0,0.2);
                                        transition: 0.3s;
                                        border-radius: 5px; 
                                      }
                                      
                                      #membership-card:hover, #facebook-card:hover, #donate-card:hover, #rentals-card:hover  {
                                        box-shadow: 0 16px 32px 0 rgba(0,0,0,0.2);
                                      }
                                      
                                      .container {
                                        padding: 2px 16px;
                                        }
                                      
                                      #iconsize {
                                        font-size: 50px;
                                        color: purple;
                                      }
                                      
                                      #smallblurbs {
                                        text-align: center;
                                        font-size: 15px;
                                        font-weight: normal;
                                      }
                                      
                                      p {
                                        font-size: 40px;
                                      }
                                      <!DOCTYPE html>
                                      <html lang="en">
                                      
                                      <head>
                                        <meta charset="utf-8">
                                        <title>Elk Beaver Lake Equestrian Society</title>
                                        <meta name="viewport" content="width=device-width, initial-scale=1">
                                        <link rel="stylesheet" href="style.css">
                                        <link rel="stylesheet" href="https://fonts.googleapis.com/icon?family=Material+Icons">
                                      </head>
                                      
                                      <body>
                                      
                                        <div class="navbar" id="navbar">
                                          <a href="#home">Home</a>
                                          <a href="#membership">Membership</a>
                                          <a href="#facilities">Facilities</a>
                                          <a href="#trails">Trails</a>
                                          <a href="#aboutus">About Us</a>
                                          <a href="https://www.facebook.com/parkridersunited/">Facebook</a>
                                        </div>
                                      
                                        <div class="grid-container">
                                      
                                          <div class="grid-item left">
                                            <form action="index.html" method="get">
                                              <div id="welcomemessage">
                                                <p id="welcomemessagep"> Welcome to EBLES! EBLES promotes sensible riding in Elk/Beaver Lake Park so that the equestrian community can co-exist with all users of the park. The community rings remain in existence because EBLES and our members maintain it for the use
                                                  of everyone.</p>
                                              </div>
                                              <div class="searchbar">
                                                <input type="text" class="searchbarinput" name="search" placeholder="Search the Website!">
                                                <button type="submit" class="searchbarbutton"> 
                                                  <i class="material-icons">search</i>
                                                </button>
                                              </div>
                                            </form>
                                      
                                            <div class="cards">
                                              <a href="membership.html">
                                                <div id="membership-card">
                                                  <i class="material-icons" id="iconsize">people</i>
                                                  <div class="container">
                                                    <p>Membership</p>
                                                    <p id=smallblurbs>Buy your 2021 membership!</p>
                                                  </div>
                                                </div>
                                              </a>
                                      
                                              <a href="https://www.facebook.com/parkridersunited/">
                                                <div id="facebook-card">
                                                  <i class="material-icons" id="iconsize">facebook</i>
                                                  <div class="container">
                                                    <p>Facebook</p>
                                                    <p id=smallblurbs>Join our community!</p>
                                                  </div>
                                                </div>
                                              </a>
                                      
                                              <a href="aboutus.html">
                                                <div id="donate-card">
                                                  <i class="material-icons" id="iconsize">savings</i>
                                                  <div class="container">
                                                    <p>Donate</p>
                                                    <p id=smallblurbs>Help support local riders!</p>
                                                  </div>
                                                </div>
                                              </a>
                                      
                                              <a href="facilities.html">
                                                <div id="rentals-card">
                                                  <i class="material-icons" id="iconsize">bedroom_baby</i>
                                                  <div class="container">
                                                    <p>Rentals</p>
                                                    <p id=smallblurbs>Want to ride? Give rentals a try!</p>
                                                  </div>
                                                </div>
                                              </a>
                                      
                                            </div>
                                      
                                      
                                          </div>
                                      
                                      
                                          <div class="grid-item footer">
                                            footer
                                          </div>
                                      
                                      
                                      
                                          <div class="grid-item right">
                                            <div id="announcements">
                                              <p id=announcements-text> Following recommendations by HCBC and Equine Canada, the 2020 EBLES Annual Poker Ride and Trail Class is postponed. Click here for more info! </p>
                                            </div>
                                            <div id="hero">
                                            </div>
                                            <div id="blurb">
                                              <p id=blurb-text> Horses are amazing. People who ride them are too. Join us today. </p>
                                            </div>
                                      
                                            <br>
                                      
                                            <div class="articles">
                                              <p id=articles-text> Here's some articles for you to read: </p>
                                              <a href="https://ebles.org/files/eblesminutesdec2020.pdf">
                                                <div id="article1"> May 3, 2021 - May 2021 Minutes </p>
                                                </div>
                                              </a>
                                              <div id="article2">
                                                <p> April 6, 2021 - April 2021 Minutes </p>
                                              </div>
                                              <div id="article3">
                                                <p> April 1, 2021 - New Baby Horse is Born!</p>
                                              </div>
                                              <div id="article4">
                                                <p> March 24, 2021 - New COVID-19 Updates </p>
                                              </div>
                                              <div id="article5">
                                                <p> March 2, 2021 - March 2021 Minutes </p>
                                              </div>
                                              <div id="article6">
                                                <p> February 8, 2021 - February 2021 Minutes </p>
                                              </div>
                                              <div id="article7">
                                                <p> January 9, 2021 - January 2021 Minutes </p>
                                              </div>
                                              <div id="article8">
                                                <p> January 1, 2021 - Happy New Year! </p>
                                              </div>
                                              <div id="article9">
                                                <p> December 25, 2020 - Merry Christmas to All! Stay safe! </p>
                                              </div>
                                              <div id="article10">
                                                <p> December 4, 2020 - December 2020 Minutes </p>
                                              </div>
                                            </div>
                                      
                                      
                                      
                                      
                                          </div>
                                        </div>
                                      
                                        <script>
                                          var prevScrollpos = window.pageYOffset;
                                          window.onscroll = function() {
                                            var currentScrollPos = window.pageYOffset;
                                            if (prevScrollpos > currentScrollPos) {
                                              document.getElementById("navbar").style.top = "0";
                                            } else {
                                              document.getElementById("navbar").style.top = "-20%";
                                            }
                                            prevScrollpos = currentScrollPos;
                                          }
                                        </script>
                                      
                                      
                                      </body>
                                      
                                      </html>
                                      height: 100%;
                                      position: fixed;
                                      
                                      width: 50%;
                                      position: absolute;
                                      right: 0;
                                      
                                      z-index: 1
                                      
                                       * {
                                        margin: 0;
                                      
                                        box-sizing: border-box;
                                      }
                                      
                                      /* The grid container */
                                      .grid-container {
                                        height: 100vh;
                                        display: grid;
                                        grid-template-areas: 
                                          'left right' 
                                          'footer right';
                                      } 
                                      
                                      .grid-item {
                                      
                                              }
                                      
                                              .left { 
                                                  /*grid-area: left;*/
                                                  height: 100%;
                                            position: fixed;
                                            padding-top: 100px;
                                            padding-left: 20px;
                                            padding-right: 20px;
                                            padding-bottom: 20px;
                                            background-color: #ccc;
                                            max-width: 45em;
                                            word-wrap: break-word;
                                              }
                                      
                                          #welcomemessagep {
                                            font-family: century gothic, sans-serif;
                                            color: white;
                                            font-size: 20px;
                                            padding: 20px;
                                          }
                                      
                                          .searchbar {
                                            padding: 20px;
                                            width: 100%;
                                            display: inline-flex;
                                            justify-content: center;
                                      
                                          }
                                      
                                          .searchbarinput {
                                            flex: grow 1;
                                            padding: 10px;
                                            outline: none;
                                            border: 1px solid purple;
                                            border-radius: 5px 0 0 5px;
                                            background: white;
                                            transition: background 0.25s, box-shadow 0.25s;
                                            width: 75%;
                                            height: 5vh;
                                          }
                                      
                                          .searchbarinput:focus {
                                            background: white;
                                            box-shadow: 0 0 2px purple;
                                          }
                                      
                                          .searchbarinput::placeholder {
                                            color: purple;
                                          }
                                      
                                          .searchbarbutton {
                                            width: 40px;
                                            background: purple;
                                            color: white;
                                            outline: none;
                                            border: none;
                                            display: flex;
                                            align-items: center;
                                            justify-content: center;
                                            border-radius: 0 5px 5px 0;
                                            cursor: pointer;
                                            user-select: none;
                                          }
                                      
                                          .searchbarbutton:active {
                                            box-shadow: inset 0 0 30px rgba(0, 0, 0, 0.25);
                                          }
                                      
                                      
                                              .right {
                                                  grid-area: right;
                                            padding-top: 100px;
                                            grid-template-areas: 
                                            'announcements'
                                            'hero'
                                            'blurb'
                                            'articles';
                                            background-color: black;
                                            width: 50%;
                                            position: absolute;
                                            right: 0;
                                              }
                                      
                                          #announcements-text {
                                            font-family: century gothic, sans-serif;
                                            color: red;
                                            padding: 20px;
                                            font-size: 20px;
                                            padding: 20px;
                                          }
                                      
                                          #hero {
                                            background-image: url("images/horse.jpg");
                                            height: 100vh;
                                            width: 100%;
                                          }
                                      
                                          #blurb-text {
                                            font-family: century gothic, sans-serif;
                                            color: white;
                                            font-size: 40px;
                                            padding: 20px;
                                          }
                                      
                                          .articles {
                                            font-family: century gothic, sans-serif;
                                            color: white;
                                            font-size: 40px;
                                            padding: 20px;
                                          }
                                      
                                          #articles-text {
                                            font-family: century gothic, sans-serif;
                                            color: white;
                                            font-size: 40px;
                                            padding-bottom: 20px;
                                            padding-left: 10px;
                                          }
                                      
                                          #article1, #article2, #article3, #article4, #article5, #article6, #article7, #article8, #article9, #article10 {
                                            border: 3px solid white;
                                            color: white;
                                            padding: 10px;
                                          }
                                      
                                          #article1:hover, #article2:hover, #article3:hover, #article4:hover, #article5:hover, #article6:hover, #article7:hover, #article8:hover, #article9:hover, #article10:hover {
                                            background-color: purple;
                                          }
                                      
                                      
                                      
                                          a:link {
                                            text-decoration: none;
                                            color: black;
                                          }
                                      
                                          a:visited {
                                            color: black;
                                          }
                                      
                                          a:active {
                                            color: black;
                                          }
                                      
                                              .footer{
                                                  grid-area: footer;  
                                            background-color: #ccc;
                                          }
                                      
                                      .navbar {
                                        font-family: century gothic, sans-serif;
                                        background-color: #333;
                                        position: fixed;
                                        top: 0;
                                        width: 100%;
                                        display: flex;
                                        justify-content: center;
                                        transition: top 0.3s;
                                        padding: 20px;
                                        z-index: 1;
                                      }       
                                      
                                      .navbar a {
                                        float: left;
                                        display: block;
                                        color: white;
                                        text-align: center;
                                        padding: 15px;
                                        text-decoration: none;
                                      }
                                      
                                      .navbar a:hover {
                                        text-decoration: underline;
                                        text-underline-offset: 8px;
                                      }
                                      
                                      .cards {
                                        height: 20vh;
                                        display: grid;
                                          grid-template-areas: 
                                          'membership-card facebook-card' 
                                          'donate-card rentals-card';
                                        gap: 2em;
                                        padding: 30px;
                                      }
                                      
                                      #membership-card, #facebook-card, #donate-card, #rentals-card  {
                                        text-align: center;
                                        font-size: 20px;
                                        font-weight: bold;
                                        padding: 20px;
                                        box-shadow: 0 4px 8px 0 rgba(0,0,0,0.2);
                                        transition: 0.3s;
                                        border-radius: 5px; 
                                      }
                                      
                                      #membership-card:hover, #facebook-card:hover, #donate-card:hover, #rentals-card:hover  {
                                        box-shadow: 0 16px 32px 0 rgba(0,0,0,0.2);
                                      }
                                      
                                      .container {
                                        padding: 2px 16px;
                                        }
                                      
                                      #iconsize {
                                        font-size: 50px;
                                        color: purple;
                                      }
                                      
                                      #smallblurbs {
                                        text-align: center;
                                        font-size: 15px;
                                        font-weight: normal;
                                      }
                                      
                                      p {
                                        font-size: 40px;
                                      }
                                      <!DOCTYPE html>
                                      <html lang="en">
                                      
                                      <head>
                                        <meta charset="utf-8">
                                        <title>Elk Beaver Lake Equestrian Society</title>
                                        <meta name="viewport" content="width=device-width, initial-scale=1">
                                        <link rel="stylesheet" href="style.css">
                                        <link rel="stylesheet" href="https://fonts.googleapis.com/icon?family=Material+Icons">
                                      </head>
                                      
                                      <body>
                                      
                                        <div class="navbar" id="navbar">
                                          <a href="#home">Home</a>
                                          <a href="#membership">Membership</a>
                                          <a href="#facilities">Facilities</a>
                                          <a href="#trails">Trails</a>
                                          <a href="#aboutus">About Us</a>
                                          <a href="https://www.facebook.com/parkridersunited/">Facebook</a>
                                        </div>
                                      
                                        <div class="grid-container">
                                      
                                          <div class="grid-item left">
                                            <form action="index.html" method="get">
                                              <div id="welcomemessage">
                                                <p id="welcomemessagep"> Welcome to EBLES! EBLES promotes sensible riding in Elk/Beaver Lake Park so that the equestrian community can co-exist with all users of the park. The community rings remain in existence because EBLES and our members maintain it for the use
                                                  of everyone.</p>
                                              </div>
                                              <div class="searchbar">
                                                <input type="text" class="searchbarinput" name="search" placeholder="Search the Website!">
                                                <button type="submit" class="searchbarbutton"> 
                                                  <i class="material-icons">search</i>
                                                </button>
                                              </div>
                                            </form>
                                      
                                            <div class="cards">
                                              <a href="membership.html">
                                                <div id="membership-card">
                                                  <i class="material-icons" id="iconsize">people</i>
                                                  <div class="container">
                                                    <p>Membership</p>
                                                    <p id=smallblurbs>Buy your 2021 membership!</p>
                                                  </div>
                                                </div>
                                              </a>
                                      
                                              <a href="https://www.facebook.com/parkridersunited/">
                                                <div id="facebook-card">
                                                  <i class="material-icons" id="iconsize">facebook</i>
                                                  <div class="container">
                                                    <p>Facebook</p>
                                                    <p id=smallblurbs>Join our community!</p>
                                                  </div>
                                                </div>
                                              </a>
                                      
                                              <a href="aboutus.html">
                                                <div id="donate-card">
                                                  <i class="material-icons" id="iconsize">savings</i>
                                                  <div class="container">
                                                    <p>Donate</p>
                                                    <p id=smallblurbs>Help support local riders!</p>
                                                  </div>
                                                </div>
                                              </a>
                                      
                                              <a href="facilities.html">
                                                <div id="rentals-card">
                                                  <i class="material-icons" id="iconsize">bedroom_baby</i>
                                                  <div class="container">
                                                    <p>Rentals</p>
                                                    <p id=smallblurbs>Want to ride? Give rentals a try!</p>
                                                  </div>
                                                </div>
                                              </a>
                                      
                                            </div>
                                      
                                      
                                          </div>
                                      
                                      
                                          <div class="grid-item footer">
                                            footer
                                          </div>
                                      
                                      
                                      
                                          <div class="grid-item right">
                                            <div id="announcements">
                                              <p id=announcements-text> Following recommendations by HCBC and Equine Canada, the 2020 EBLES Annual Poker Ride and Trail Class is postponed. Click here for more info! </p>
                                            </div>
                                            <div id="hero">
                                            </div>
                                            <div id="blurb">
                                              <p id=blurb-text> Horses are amazing. People who ride them are too. Join us today. </p>
                                            </div>
                                      
                                            <br>
                                      
                                            <div class="articles">
                                              <p id=articles-text> Here's some articles for you to read: </p>
                                              <a href="https://ebles.org/files/eblesminutesdec2020.pdf">
                                                <div id="article1"> May 3, 2021 - May 2021 Minutes </p>
                                                </div>
                                              </a>
                                              <div id="article2">
                                                <p> April 6, 2021 - April 2021 Minutes </p>
                                              </div>
                                              <div id="article3">
                                                <p> April 1, 2021 - New Baby Horse is Born!</p>
                                              </div>
                                              <div id="article4">
                                                <p> March 24, 2021 - New COVID-19 Updates </p>
                                              </div>
                                              <div id="article5">
                                                <p> March 2, 2021 - March 2021 Minutes </p>
                                              </div>
                                              <div id="article6">
                                                <p> February 8, 2021 - February 2021 Minutes </p>
                                              </div>
                                              <div id="article7">
                                                <p> January 9, 2021 - January 2021 Minutes </p>
                                              </div>
                                              <div id="article8">
                                                <p> January 1, 2021 - Happy New Year! </p>
                                              </div>
                                              <div id="article9">
                                                <p> December 25, 2020 - Merry Christmas to All! Stay safe! </p>
                                              </div>
                                              <div id="article10">
                                                <p> December 4, 2020 - December 2020 Minutes </p>
                                              </div>
                                            </div>
                                      
                                      
                                      
                                      
                                          </div>
                                        </div>
                                      
                                        <script>
                                          var prevScrollpos = window.pageYOffset;
                                          window.onscroll = function() {
                                            var currentScrollPos = window.pageYOffset;
                                            if (prevScrollpos > currentScrollPos) {
                                              document.getElementById("navbar").style.top = "0";
                                            } else {
                                              document.getElementById("navbar").style.top = "-20%";
                                            }
                                            prevScrollpos = currentScrollPos;
                                          }
                                        </script>
                                      
                                      
                                      </body>
                                      
                                      </html>
                                      height: 100%;
                                      position: fixed;
                                      
                                      width: 50%;
                                      position: absolute;
                                      right: 0;
                                      
                                      z-index: 1
                                      
                                       * {
                                        margin: 0;
                                      
                                        box-sizing: border-box;
                                      }
                                      
                                      /* The grid container */
                                      .grid-container {
                                        height: 100vh;
                                        display: grid;
                                        grid-template-areas: 
                                          'left right' 
                                          'footer right';
                                      } 
                                      
                                      .grid-item {
                                      
                                              }
                                      
                                              .left { 
                                                  /*grid-area: left;*/
                                                  height: 100%;
                                            position: fixed;
                                            padding-top: 100px;
                                            padding-left: 20px;
                                            padding-right: 20px;
                                            padding-bottom: 20px;
                                            background-color: #ccc;
                                            max-width: 45em;
                                            word-wrap: break-word;
                                              }
                                      
                                          #welcomemessagep {
                                            font-family: century gothic, sans-serif;
                                            color: white;
                                            font-size: 20px;
                                            padding: 20px;
                                          }
                                      
                                          .searchbar {
                                            padding: 20px;
                                            width: 100%;
                                            display: inline-flex;
                                            justify-content: center;
                                      
                                          }
                                      
                                          .searchbarinput {
                                            flex: grow 1;
                                            padding: 10px;
                                            outline: none;
                                            border: 1px solid purple;
                                            border-radius: 5px 0 0 5px;
                                            background: white;
                                            transition: background 0.25s, box-shadow 0.25s;
                                            width: 75%;
                                            height: 5vh;
                                          }
                                      
                                          .searchbarinput:focus {
                                            background: white;
                                            box-shadow: 0 0 2px purple;
                                          }
                                      
                                          .searchbarinput::placeholder {
                                            color: purple;
                                          }
                                      
                                          .searchbarbutton {
                                            width: 40px;
                                            background: purple;
                                            color: white;
                                            outline: none;
                                            border: none;
                                            display: flex;
                                            align-items: center;
                                            justify-content: center;
                                            border-radius: 0 5px 5px 0;
                                            cursor: pointer;
                                            user-select: none;
                                          }
                                      
                                          .searchbarbutton:active {
                                            box-shadow: inset 0 0 30px rgba(0, 0, 0, 0.25);
                                          }
                                      
                                      
                                              .right {
                                                  grid-area: right;
                                            padding-top: 100px;
                                            grid-template-areas: 
                                            'announcements'
                                            'hero'
                                            'blurb'
                                            'articles';
                                            background-color: black;
                                            width: 50%;
                                            position: absolute;
                                            right: 0;
                                              }
                                      
                                          #announcements-text {
                                            font-family: century gothic, sans-serif;
                                            color: red;
                                            padding: 20px;
                                            font-size: 20px;
                                            padding: 20px;
                                          }
                                      
                                          #hero {
                                            background-image: url("images/horse.jpg");
                                            height: 100vh;
                                            width: 100%;
                                          }
                                      
                                          #blurb-text {
                                            font-family: century gothic, sans-serif;
                                            color: white;
                                            font-size: 40px;
                                            padding: 20px;
                                          }
                                      
                                          .articles {
                                            font-family: century gothic, sans-serif;
                                            color: white;
                                            font-size: 40px;
                                            padding: 20px;
                                          }
                                      
                                          #articles-text {
                                            font-family: century gothic, sans-serif;
                                            color: white;
                                            font-size: 40px;
                                            padding-bottom: 20px;
                                            padding-left: 10px;
                                          }
                                      
                                          #article1, #article2, #article3, #article4, #article5, #article6, #article7, #article8, #article9, #article10 {
                                            border: 3px solid white;
                                            color: white;
                                            padding: 10px;
                                          }
                                      
                                          #article1:hover, #article2:hover, #article3:hover, #article4:hover, #article5:hover, #article6:hover, #article7:hover, #article8:hover, #article9:hover, #article10:hover {
                                            background-color: purple;
                                          }
                                      
                                      
                                      
                                          a:link {
                                            text-decoration: none;
                                            color: black;
                                          }
                                      
                                          a:visited {
                                            color: black;
                                          }
                                      
                                          a:active {
                                            color: black;
                                          }
                                      
                                              .footer{
                                                  grid-area: footer;  
                                            background-color: #ccc;
                                          }
                                      
                                      .navbar {
                                        font-family: century gothic, sans-serif;
                                        background-color: #333;
                                        position: fixed;
                                        top: 0;
                                        width: 100%;
                                        display: flex;
                                        justify-content: center;
                                        transition: top 0.3s;
                                        padding: 20px;
                                        z-index: 1;
                                      }       
                                      
                                      .navbar a {
                                        float: left;
                                        display: block;
                                        color: white;
                                        text-align: center;
                                        padding: 15px;
                                        text-decoration: none;
                                      }
                                      
                                      .navbar a:hover {
                                        text-decoration: underline;
                                        text-underline-offset: 8px;
                                      }
                                      
                                      .cards {
                                        height: 20vh;
                                        display: grid;
                                          grid-template-areas: 
                                          'membership-card facebook-card' 
                                          'donate-card rentals-card';
                                        gap: 2em;
                                        padding: 30px;
                                      }
                                      
                                      #membership-card, #facebook-card, #donate-card, #rentals-card  {
                                        text-align: center;
                                        font-size: 20px;
                                        font-weight: bold;
                                        padding: 20px;
                                        box-shadow: 0 4px 8px 0 rgba(0,0,0,0.2);
                                        transition: 0.3s;
                                        border-radius: 5px; 
                                      }
                                      
                                      #membership-card:hover, #facebook-card:hover, #donate-card:hover, #rentals-card:hover  {
                                        box-shadow: 0 16px 32px 0 rgba(0,0,0,0.2);
                                      }
                                      
                                      .container {
                                        padding: 2px 16px;
                                        }
                                      
                                      #iconsize {
                                        font-size: 50px;
                                        color: purple;
                                      }
                                      
                                      #smallblurbs {
                                        text-align: center;
                                        font-size: 15px;
                                        font-weight: normal;
                                      }
                                      
                                      p {
                                        font-size: 40px;
                                      }
                                      <!DOCTYPE html>
                                      <html lang="en">
                                      
                                      <head>
                                        <meta charset="utf-8">
                                        <title>Elk Beaver Lake Equestrian Society</title>
                                        <meta name="viewport" content="width=device-width, initial-scale=1">
                                        <link rel="stylesheet" href="style.css">
                                        <link rel="stylesheet" href="https://fonts.googleapis.com/icon?family=Material+Icons">
                                      </head>
                                      
                                      <body>
                                      
                                        <div class="navbar" id="navbar">
                                          <a href="#home">Home</a>
                                          <a href="#membership">Membership</a>
                                          <a href="#facilities">Facilities</a>
                                          <a href="#trails">Trails</a>
                                          <a href="#aboutus">About Us</a>
                                          <a href="https://www.facebook.com/parkridersunited/">Facebook</a>
                                        </div>
                                      
                                        <div class="grid-container">
                                      
                                          <div class="grid-item left">
                                            <form action="index.html" method="get">
                                              <div id="welcomemessage">
                                                <p id="welcomemessagep"> Welcome to EBLES! EBLES promotes sensible riding in Elk/Beaver Lake Park so that the equestrian community can co-exist with all users of the park. The community rings remain in existence because EBLES and our members maintain it for the use
                                                  of everyone.</p>
                                              </div>
                                              <div class="searchbar">
                                                <input type="text" class="searchbarinput" name="search" placeholder="Search the Website!">
                                                <button type="submit" class="searchbarbutton"> 
                                                  <i class="material-icons">search</i>
                                                </button>
                                              </div>
                                            </form>
                                      
                                            <div class="cards">
                                              <a href="membership.html">
                                                <div id="membership-card">
                                                  <i class="material-icons" id="iconsize">people</i>
                                                  <div class="container">
                                                    <p>Membership</p>
                                                    <p id=smallblurbs>Buy your 2021 membership!</p>
                                                  </div>
                                                </div>
                                              </a>
                                      
                                              <a href="https://www.facebook.com/parkridersunited/">
                                                <div id="facebook-card">
                                                  <i class="material-icons" id="iconsize">facebook</i>
                                                  <div class="container">
                                                    <p>Facebook</p>
                                                    <p id=smallblurbs>Join our community!</p>
                                                  </div>
                                                </div>
                                              </a>
                                      
                                              <a href="aboutus.html">
                                                <div id="donate-card">
                                                  <i class="material-icons" id="iconsize">savings</i>
                                                  <div class="container">
                                                    <p>Donate</p>
                                                    <p id=smallblurbs>Help support local riders!</p>
                                                  </div>
                                                </div>
                                              </a>
                                      
                                              <a href="facilities.html">
                                                <div id="rentals-card">
                                                  <i class="material-icons" id="iconsize">bedroom_baby</i>
                                                  <div class="container">
                                                    <p>Rentals</p>
                                                    <p id=smallblurbs>Want to ride? Give rentals a try!</p>
                                                  </div>
                                                </div>
                                              </a>
                                      
                                            </div>
                                      
                                      
                                          </div>
                                      
                                      
                                          <div class="grid-item footer">
                                            footer
                                          </div>
                                      
                                      
                                      
                                          <div class="grid-item right">
                                            <div id="announcements">
                                              <p id=announcements-text> Following recommendations by HCBC and Equine Canada, the 2020 EBLES Annual Poker Ride and Trail Class is postponed. Click here for more info! </p>
                                            </div>
                                            <div id="hero">
                                            </div>
                                            <div id="blurb">
                                              <p id=blurb-text> Horses are amazing. People who ride them are too. Join us today. </p>
                                            </div>
                                      
                                            <br>
                                      
                                            <div class="articles">
                                              <p id=articles-text> Here's some articles for you to read: </p>
                                              <a href="https://ebles.org/files/eblesminutesdec2020.pdf">
                                                <div id="article1"> May 3, 2021 - May 2021 Minutes </p>
                                                </div>
                                              </a>
                                              <div id="article2">
                                                <p> April 6, 2021 - April 2021 Minutes </p>
                                              </div>
                                              <div id="article3">
                                                <p> April 1, 2021 - New Baby Horse is Born!</p>
                                              </div>
                                              <div id="article4">
                                                <p> March 24, 2021 - New COVID-19 Updates </p>
                                              </div>
                                              <div id="article5">
                                                <p> March 2, 2021 - March 2021 Minutes </p>
                                              </div>
                                              <div id="article6">
                                                <p> February 8, 2021 - February 2021 Minutes </p>
                                              </div>
                                              <div id="article7">
                                                <p> January 9, 2021 - January 2021 Minutes </p>
                                              </div>
                                              <div id="article8">
                                                <p> January 1, 2021 - Happy New Year! </p>
                                              </div>
                                              <div id="article9">
                                                <p> December 25, 2020 - Merry Christmas to All! Stay safe! </p>
                                              </div>
                                              <div id="article10">
                                                <p> December 4, 2020 - December 2020 Minutes </p>
                                              </div>
                                            </div>
                                      
                                      
                                      
                                      
                                          </div>
                                        </div>
                                      
                                        <script>
                                          var prevScrollpos = window.pageYOffset;
                                          window.onscroll = function() {
                                            var currentScrollPos = window.pageYOffset;
                                            if (prevScrollpos > currentScrollPos) {
                                              document.getElementById("navbar").style.top = "0";
                                            } else {
                                              document.getElementById("navbar").style.top = "-20%";
                                            }
                                            prevScrollpos = currentScrollPos;
                                          }
                                        </script>
                                      
                                      
                                      </body>
                                      
                                      </html>
                                      height: 100%;
                                      position: fixed;
                                      
                                      width: 50%;
                                      position: absolute;
                                      right: 0;
                                      
                                      z-index: 1
                                      
                                       * {
                                        margin: 0;
                                      
                                        box-sizing: border-box;
                                      }
                                      
                                      /* The grid container */
                                      .grid-container {
                                        height: 100vh;
                                        display: grid;
                                        grid-template-areas: 
                                          'left right' 
                                          'footer right';
                                      } 
                                      
                                      .grid-item {
                                      
                                              }
                                      
                                              .left { 
                                                  /*grid-area: left;*/
                                                  height: 100%;
                                            position: fixed;
                                            padding-top: 100px;
                                            padding-left: 20px;
                                            padding-right: 20px;
                                            padding-bottom: 20px;
                                            background-color: #ccc;
                                            max-width: 45em;
                                            word-wrap: break-word;
                                              }
                                      
                                          #welcomemessagep {
                                            font-family: century gothic, sans-serif;
                                            color: white;
                                            font-size: 20px;
                                            padding: 20px;
                                          }
                                      
                                          .searchbar {
                                            padding: 20px;
                                            width: 100%;
                                            display: inline-flex;
                                            justify-content: center;
                                      
                                          }
                                      
                                          .searchbarinput {
                                            flex: grow 1;
                                            padding: 10px;
                                            outline: none;
                                            border: 1px solid purple;
                                            border-radius: 5px 0 0 5px;
                                            background: white;
                                            transition: background 0.25s, box-shadow 0.25s;
                                            width: 75%;
                                            height: 5vh;
                                          }
                                      
                                          .searchbarinput:focus {
                                            background: white;
                                            box-shadow: 0 0 2px purple;
                                          }
                                      
                                          .searchbarinput::placeholder {
                                            color: purple;
                                          }
                                      
                                          .searchbarbutton {
                                            width: 40px;
                                            background: purple;
                                            color: white;
                                            outline: none;
                                            border: none;
                                            display: flex;
                                            align-items: center;
                                            justify-content: center;
                                            border-radius: 0 5px 5px 0;
                                            cursor: pointer;
                                            user-select: none;
                                          }
                                      
                                          .searchbarbutton:active {
                                            box-shadow: inset 0 0 30px rgba(0, 0, 0, 0.25);
                                          }
                                      
                                      
                                              .right {
                                                  grid-area: right;
                                            padding-top: 100px;
                                            grid-template-areas: 
                                            'announcements'
                                            'hero'
                                            'blurb'
                                            'articles';
                                            background-color: black;
                                            width: 50%;
                                            position: absolute;
                                            right: 0;
                                              }
                                      
                                          #announcements-text {
                                            font-family: century gothic, sans-serif;
                                            color: red;
                                            padding: 20px;
                                            font-size: 20px;
                                            padding: 20px;
                                          }
                                      
                                          #hero {
                                            background-image: url("images/horse.jpg");
                                            height: 100vh;
                                            width: 100%;
                                          }
                                      
                                          #blurb-text {
                                            font-family: century gothic, sans-serif;
                                            color: white;
                                            font-size: 40px;
                                            padding: 20px;
                                          }
                                      
                                          .articles {
                                            font-family: century gothic, sans-serif;
                                            color: white;
                                            font-size: 40px;
                                            padding: 20px;
                                          }
                                      
                                          #articles-text {
                                            font-family: century gothic, sans-serif;
                                            color: white;
                                            font-size: 40px;
                                            padding-bottom: 20px;
                                            padding-left: 10px;
                                          }
                                      
                                          #article1, #article2, #article3, #article4, #article5, #article6, #article7, #article8, #article9, #article10 {
                                            border: 3px solid white;
                                            color: white;
                                            padding: 10px;
                                          }
                                      
                                          #article1:hover, #article2:hover, #article3:hover, #article4:hover, #article5:hover, #article6:hover, #article7:hover, #article8:hover, #article9:hover, #article10:hover {
                                            background-color: purple;
                                          }
                                      
                                      
                                      
                                          a:link {
                                            text-decoration: none;
                                            color: black;
                                          }
                                      
                                          a:visited {
                                            color: black;
                                          }
                                      
                                          a:active {
                                            color: black;
                                          }
                                      
                                              .footer{
                                                  grid-area: footer;  
                                            background-color: #ccc;
                                          }
                                      
                                      .navbar {
                                        font-family: century gothic, sans-serif;
                                        background-color: #333;
                                        position: fixed;
                                        top: 0;
                                        width: 100%;
                                        display: flex;
                                        justify-content: center;
                                        transition: top 0.3s;
                                        padding: 20px;
                                        z-index: 1;
                                      }       
                                      
                                      .navbar a {
                                        float: left;
                                        display: block;
                                        color: white;
                                        text-align: center;
                                        padding: 15px;
                                        text-decoration: none;
                                      }
                                      
                                      .navbar a:hover {
                                        text-decoration: underline;
                                        text-underline-offset: 8px;
                                      }
                                      
                                      .cards {
                                        height: 20vh;
                                        display: grid;
                                          grid-template-areas: 
                                          'membership-card facebook-card' 
                                          'donate-card rentals-card';
                                        gap: 2em;
                                        padding: 30px;
                                      }
                                      
                                      #membership-card, #facebook-card, #donate-card, #rentals-card  {
                                        text-align: center;
                                        font-size: 20px;
                                        font-weight: bold;
                                        padding: 20px;
                                        box-shadow: 0 4px 8px 0 rgba(0,0,0,0.2);
                                        transition: 0.3s;
                                        border-radius: 5px; 
                                      }
                                      
                                      #membership-card:hover, #facebook-card:hover, #donate-card:hover, #rentals-card:hover  {
                                        box-shadow: 0 16px 32px 0 rgba(0,0,0,0.2);
                                      }
                                      
                                      .container {
                                        padding: 2px 16px;
                                        }
                                      
                                      #iconsize {
                                        font-size: 50px;
                                        color: purple;
                                      }
                                      
                                      #smallblurbs {
                                        text-align: center;
                                        font-size: 15px;
                                        font-weight: normal;
                                      }
                                      
                                      p {
                                        font-size: 40px;
                                      }
                                      <!DOCTYPE html>
                                      <html lang="en">
                                      
                                      <head>
                                        <meta charset="utf-8">
                                        <title>Elk Beaver Lake Equestrian Society</title>
                                        <meta name="viewport" content="width=device-width, initial-scale=1">
                                        <link rel="stylesheet" href="style.css">
                                        <link rel="stylesheet" href="https://fonts.googleapis.com/icon?family=Material+Icons">
                                      </head>
                                      
                                      <body>
                                      
                                        <div class="navbar" id="navbar">
                                          <a href="#home">Home</a>
                                          <a href="#membership">Membership</a>
                                          <a href="#facilities">Facilities</a>
                                          <a href="#trails">Trails</a>
                                          <a href="#aboutus">About Us</a>
                                          <a href="https://www.facebook.com/parkridersunited/">Facebook</a>
                                        </div>
                                      
                                        <div class="grid-container">
                                      
                                          <div class="grid-item left">
                                            <form action="index.html" method="get">
                                              <div id="welcomemessage">
                                                <p id="welcomemessagep"> Welcome to EBLES! EBLES promotes sensible riding in Elk/Beaver Lake Park so that the equestrian community can co-exist with all users of the park. The community rings remain in existence because EBLES and our members maintain it for the use
                                                  of everyone.</p>
                                              </div>
                                              <div class="searchbar">
                                                <input type="text" class="searchbarinput" name="search" placeholder="Search the Website!">
                                                <button type="submit" class="searchbarbutton"> 
                                                  <i class="material-icons">search</i>
                                                </button>
                                              </div>
                                            </form>
                                      
                                            <div class="cards">
                                              <a href="membership.html">
                                                <div id="membership-card">
                                                  <i class="material-icons" id="iconsize">people</i>
                                                  <div class="container">
                                                    <p>Membership</p>
                                                    <p id=smallblurbs>Buy your 2021 membership!</p>
                                                  </div>
                                                </div>
                                              </a>
                                      
                                              <a href="https://www.facebook.com/parkridersunited/">
                                                <div id="facebook-card">
                                                  <i class="material-icons" id="iconsize">facebook</i>
                                                  <div class="container">
                                                    <p>Facebook</p>
                                                    <p id=smallblurbs>Join our community!</p>
                                                  </div>
                                                </div>
                                              </a>
                                      
                                              <a href="aboutus.html">
                                                <div id="donate-card">
                                                  <i class="material-icons" id="iconsize">savings</i>
                                                  <div class="container">
                                                    <p>Donate</p>
                                                    <p id=smallblurbs>Help support local riders!</p>
                                                  </div>
                                                </div>
                                              </a>
                                      
                                              <a href="facilities.html">
                                                <div id="rentals-card">
                                                  <i class="material-icons" id="iconsize">bedroom_baby</i>
                                                  <div class="container">
                                                    <p>Rentals</p>
                                                    <p id=smallblurbs>Want to ride? Give rentals a try!</p>
                                                  </div>
                                                </div>
                                              </a>
                                      
                                            </div>
                                      
                                      
                                          </div>
                                      
                                      
                                          <div class="grid-item footer">
                                            footer
                                          </div>
                                      
                                      
                                      
                                          <div class="grid-item right">
                                            <div id="announcements">
                                              <p id=announcements-text> Following recommendations by HCBC and Equine Canada, the 2020 EBLES Annual Poker Ride and Trail Class is postponed. Click here for more info! </p>
                                            </div>
                                            <div id="hero">
                                            </div>
                                            <div id="blurb">
                                              <p id=blurb-text> Horses are amazing. People who ride them are too. Join us today. </p>
                                            </div>
                                      
                                            <br>
                                      
                                            <div class="articles">
                                              <p id=articles-text> Here's some articles for you to read: </p>
                                              <a href="https://ebles.org/files/eblesminutesdec2020.pdf">
                                                <div id="article1"> May 3, 2021 - May 2021 Minutes </p>
                                                </div>
                                              </a>
                                              <div id="article2">
                                                <p> April 6, 2021 - April 2021 Minutes </p>
                                              </div>
                                              <div id="article3">
                                                <p> April 1, 2021 - New Baby Horse is Born!</p>
                                              </div>
                                              <div id="article4">
                                                <p> March 24, 2021 - New COVID-19 Updates </p>
                                              </div>
                                              <div id="article5">
                                                <p> March 2, 2021 - March 2021 Minutes </p>
                                              </div>
                                              <div id="article6">
                                                <p> February 8, 2021 - February 2021 Minutes </p>
                                              </div>
                                              <div id="article7">
                                                <p> January 9, 2021 - January 2021 Minutes </p>
                                              </div>
                                              <div id="article8">
                                                <p> January 1, 2021 - Happy New Year! </p>
                                              </div>
                                              <div id="article9">
                                                <p> December 25, 2020 - Merry Christmas to All! Stay safe! </p>
                                              </div>
                                              <div id="article10">
                                                <p> December 4, 2020 - December 2020 Minutes </p>
                                              </div>
                                            </div>
                                      
                                      
                                      
                                      
                                          </div>
                                        </div>
                                      
                                        <script>
                                          var prevScrollpos = window.pageYOffset;
                                          window.onscroll = function() {
                                            var currentScrollPos = window.pageYOffset;
                                            if (prevScrollpos > currentScrollPos) {
                                              document.getElementById("navbar").style.top = "0";
                                            } else {
                                              document.getElementById("navbar").style.top = "-20%";
                                            }
                                            prevScrollpos = currentScrollPos;
                                          }
                                        </script>
                                      
                                      
                                      </body>
                                      
                                      </html>

                                      showResult function in blackjack not working

                                      copy iconCopydownload iconDownload
                                          //Challenge 5: Blackjack
                                      
                                      let blackjackGame = {
                                      
                                      'dealer': {'scoreSpan': '#dealer-blackjack-result', 'div': '#dealer-box', 'score': 0},  
                                      'you': {'scoreSpan': '#your-blackjack-result', 'div': '#your-box', 'score': 0},   
                                      'cards': ['2', '3', '4', '5', '6', '7', '8', '9', '10', 'K', 'J', 'Q', 'A'],
                                      'cardsMap': {'2': 2, '3': 3, '4': 4, '5': 5, '6': 6, '7': 7, '8': 8, '9': 9, '10': 10, 'K': 10, 'J': 10, 'Q': 10, 'A': [1, 11]}
                                      
                                      };
                                      
                                      
                                      const YOU = blackjackGame['you']
                                      const DEALER = blackjackGame['dealer']
                                      
                                      const hitSound = new Audio('static/sounds/swish.m4a');
                                      const winSound = new Audio('static/sounds/cash.mp3');
                                      const lossSound = new Audio('static/sounds/aww.mp3');
                                      
                                      document.querySelector('#blackjack-hit-button').addEventListener('click', blackjackHit);
                                      document.querySelector('#blackjack-stand-button').addEventListener('click', dealerLogic);
                                      document.querySelector('#blackjack-deal-button').addEventListener('click', blackjackDeal);
                                      
                                      function blackjackHit() {
                                      let card = randomCard();
                                      showCard(card, YOU);
                                      updateScore(card, YOU);
                                      showScore(YOU);}
                                      
                                      
                                      function randomCard() {
                                          let randomIndex = Math.floor(Math.random() * 13);
                                          return blackjackGame['cards'][randomIndex];
                                          }
                                      
                                      
                                      function showCard(card, activePlayer) {
                                          if (activePlayer['score'] <= 21) {
                                          let cardImage = document.createElement('img');
                                          cardImage.src = `static/images/${card}.png`;
                                          document.querySelector(activePlayer['div']).appendChild(cardImage);
                                          hitSound.play(); }  
                                      }
                                      
                                      function blackjackDeal() {
                                      
                                          
                                          showResult(computeWinner());
                                          let yourImages = document.querySelector('#your-box').querySelectorAll('img');
                                          let dealerImages = document.querySelector('#dealer-box').querySelectorAll('img');
                                          
                                      
                                          for (i=0; i < yourImages.length; i++) {
                                              yourImages[i].remove();
                                          }
                                      
                                      
                                          for (i=0; i < dealerImages.length; i++) {
                                              dealerImages[i].remove();
                                          }
                                      
                                      YOU['score'] = 0;
                                      DEALER['score'] = 0;
                                      
                                      document.querySelector('#your-blackjack-result').textContent = 0;
                                      document.querySelector('#your-blackjack-result').style.color = 'white';
                                      
                                      document.querySelector('#dealer-blackjack-result').textContent = 0;
                                      document.querySelector('#dealer-blackjack-result').style.color = 'white';
                                      }
                                      
                                      function updateScore(card, activePlayer) {
                                      
                                      
                                      if (card === 'A') {
                                      
                                          if (activePlayer['score'] + blackjackGame['cardsMap'][card][1] <= 21) {
                                      activePlayer['score'] += blackjackGame['cardsMap'][card][1];
                                      
                                      }  else { 
                                      
                                      activePlayer['score'] += blackjackGame['cardsMap'][card][0];}
                                      
                                      
                                      
                                      } else {
                                      
                                      activePlayer['score'] += blackjackGame['cardsMap'][card];
                                      }
                                      }
                                      
                                      function showScore(activePlayer) {
                                      
                                      if (activePlayer['score'] > 21) {
                                          document.querySelector(activePlayer['scoreSpan']).textContent = 'BUST!';
                                          document.querySelector(activePlayer['scoreSpan']).style.color = 'red';
                                          
                                      }
                                      
                                      else {
                                      document.querySelector(activePlayer['scoreSpan']).textContent = activePlayer['score'];
                                      }
                                      
                                      }
                                      
                                      function dealerLogic() {
                                      let card = randomCard();
                                      showCard(card, DEALER);
                                      updateScore(card, DEALER);
                                      showScore(DEALER);
                                      
                                      
                                      
                                      
                                      }
                                      
                                      function computeWinner() {
                                          let winner;
                                      
                                      if (YOU['score'] <= 21) {
                                      if (YOU['score'] > DEALER['score'] || (DEALER)['score'] > 21) {
                                      console.log('You won');
                                      winner = YOU;
                                      
                                      } else if (YOU['score'] < DEALER['score']) {
                                          console.log('You lost');
                                          winner = DEALER;
                                      
                                      } else if (YOU['score'] === DEALER['score']) {
                                          console.log('You drew');
                                      }
                                      
                                      } else if (YOU['score'] > 21 && DEALER['score'] <= 21) {
                                          console.log('You lost');
                                          winner = DEALER;
                                      
                                      } else if (YOU['score'] > 21 && DEALER['score'] > 21) {
                                          console.log('You drew');
                                      
                                      }
                                      
                                      return winner;
                                      }
                                      
                                      function showResult(winner) {
                                      console.log('Winner is', winner);
                                          let message, messageColor;
                                          
                                          if (winner === YOU) {
                                          message = 'You won';
                                          messageColor = 'green';
                                          winSound.play();
                                          
                                      
                                      
                                      } else if (winner === DEALER) {
                                          message = 'You lost';
                                          messageColor = 'red';
                                          lossSound.play();
                                      
                                      } else {
                                          message = 'You drew';
                                          messageColor = 'black';
                                      }
                                      
                                      document.querySelector('#blackjack-result').textContent = message;
                                      document.querySelector('#blackjack-result').style.color = messageColor;
                                      
                                      
                                      
                                      }
                                          .flex-blackjack-row-1, .flex-blackjack-row-2 
                                      {
                                      display: flex;
                                      border: 1px solid black;
                                      padding: 10px;
                                      flex-wrap: wrap;
                                      flex-direction: row;
                                      justify-content: space-around;
                                      color: #ffffff;
                                      background: url('https://image.freepik.com/free-vector/poker-table-background-green-color_47243-1068.jpg') center;}
                                      
                                      
                                      .flex-blackjack-row-3 {
                                      
                                          display: flex;
                                          border: 1px solid black;
                                          padding: 10px;
                                          flex-wrap: wrap;
                                          flex-direction: row;
                                          justify-content: space-around;    
                                      
                                      }
                                      
                                      
                                      .flex-blackjack-row-1 div {
                                      
                                      border: 1px solid black;
                                      padding: 10px;
                                      height: 350px;
                                      text-align: center;
                                      flex: 1;
                                      }
                                      
                                      .flex-blackjack-row-1 img {
                                      
                                          width: 25%;
                                          padding: 10px;
                                      }
                                      
                                      .flex-blackjack-row-2 button {
                                      
                                      border: 1px solid black;
                                      padding: 10px;
                                      }
                                      
                                      .flex-blackjack-row-2 div {
                                      
                                      border: 1px solid black;
                                      padding: 10px;
                                      }
                                      
                                      
                                      table, th, td {
                                      
                                      padding: 5px;
                                      border: 1px solid black;
                                      
                                      }
                                      
                                      
                                      
                                      
                                      
                                      
                                      .flex-blackjack-row-2 {
                                          display: flex;
                                      border: 1px solid black;
                                      padding: 10px;
                                      flex-wrap: wrap;
                                      flex-direction: row;
                                      justify-content: space-around;
                                      }
                                      <div class="container-5"> 
                                      
                                      <h2>Blackjack Challenge</h2>
                                      <h3><span id="blackjack-result">Let's Play</span></h3>
                                      
                                      <div class="flex-blackjack-row-1">
                                          <div id="your-box">
                                              <h2>You: <span id="your-blackjack-result">0</span></h2>
                                          </div>
                                      <div id="dealer-box">
                                          <h2>Dealer: <span id="dealer-blackjack-result">0</span></h2>
                                      </div>
                                      </div>
                                      <div class="flex-blackjack-row-2">
                                          <button class="btn-lg btn-primary mr-2" id="blackjack-hit-button">Hit</button>
                                          <button class="btn-lg btn-warning mr-2" id="blackjack-stand-button">Stand</button>
                                          <button class="btn-lg btn-danger mr-2" id="blackjack-deal-button">Deal</button>
                                      </div>
                                      
                                      
                                      <div class="flex-blackjack-row-3">
                                         
                                          <table>
                                              <tr>
                                                  <th>Wins</th>
                                                  <th>Losses</th>
                                                  <th>Draws</th>
                                              </tr>
                                      
                                      <tr>
                                          <td><span id="wins">0</span></td>
                                          <td><span id="losses">0</span></td>
                                          <td><span id="draws">0</span></td>
                                          
                                      </tr>
                                      
                                          </table>
                                      
                                      </div>
                                      
                                      
                                      </div>
                                          //Challenge 5: Blackjack
                                      
                                      let blackjackGame = {
                                      
                                      'dealer': {'scoreSpan': '#dealer-blackjack-result', 'div': '#dealer-box', 'score': 0},  
                                      'you': {'scoreSpan': '#your-blackjack-result', 'div': '#your-box', 'score': 0},   
                                      'cards': ['2', '3', '4', '5', '6', '7', '8', '9', '10', 'K', 'J', 'Q', 'A'],
                                      'cardsMap': {'2': 2, '3': 3, '4': 4, '5': 5, '6': 6, '7': 7, '8': 8, '9': 9, '10': 10, 'K': 10, 'J': 10, 'Q': 10, 'A': [1, 11]}
                                      
                                      };
                                      
                                      
                                      const YOU = blackjackGame['you']
                                      const DEALER = blackjackGame['dealer']
                                      
                                      const hitSound = new Audio('static/sounds/swish.m4a');
                                      const winSound = new Audio('static/sounds/cash.mp3');
                                      const lossSound = new Audio('static/sounds/aww.mp3');
                                      
                                      document.querySelector('#blackjack-hit-button').addEventListener('click', blackjackHit);
                                      document.querySelector('#blackjack-stand-button').addEventListener('click', dealerLogic);
                                      document.querySelector('#blackjack-deal-button').addEventListener('click', blackjackDeal);
                                      
                                      function blackjackHit() {
                                      let card = randomCard();
                                      showCard(card, YOU);
                                      updateScore(card, YOU);
                                      showScore(YOU);}
                                      
                                      
                                      function randomCard() {
                                          let randomIndex = Math.floor(Math.random() * 13);
                                          return blackjackGame['cards'][randomIndex];
                                          }
                                      
                                      
                                      function showCard(card, activePlayer) {
                                          if (activePlayer['score'] <= 21) {
                                          let cardImage = document.createElement('img');
                                          cardImage.src = `static/images/${card}.png`;
                                          document.querySelector(activePlayer['div']).appendChild(cardImage);
                                          hitSound.play(); }  
                                      }
                                      
                                      function blackjackDeal() {
                                      
                                          
                                          showResult(computeWinner());
                                          let yourImages = document.querySelector('#your-box').querySelectorAll('img');
                                          let dealerImages = document.querySelector('#dealer-box').querySelectorAll('img');
                                          
                                      
                                          for (i=0; i < yourImages.length; i++) {
                                              yourImages[i].remove();
                                          }
                                      
                                      
                                          for (i=0; i < dealerImages.length; i++) {
                                              dealerImages[i].remove();
                                          }
                                      
                                      YOU['score'] = 0;
                                      DEALER['score'] = 0;
                                      
                                      document.querySelector('#your-blackjack-result').textContent = 0;
                                      document.querySelector('#your-blackjack-result').style.color = 'white';
                                      
                                      document.querySelector('#dealer-blackjack-result').textContent = 0;
                                      document.querySelector('#dealer-blackjack-result').style.color = 'white';
                                      }
                                      
                                      function updateScore(card, activePlayer) {
                                      
                                      
                                      if (card === 'A') {
                                      
                                          if (activePlayer['score'] + blackjackGame['cardsMap'][card][1] <= 21) {
                                      activePlayer['score'] += blackjackGame['cardsMap'][card][1];
                                      
                                      }  else { 
                                      
                                      activePlayer['score'] += blackjackGame['cardsMap'][card][0];}
                                      
                                      
                                      
                                      } else {
                                      
                                      activePlayer['score'] += blackjackGame['cardsMap'][card];
                                      }
                                      }
                                      
                                      function showScore(activePlayer) {
                                      
                                      if (activePlayer['score'] > 21) {
                                          document.querySelector(activePlayer['scoreSpan']).textContent = 'BUST!';
                                          document.querySelector(activePlayer['scoreSpan']).style.color = 'red';
                                          
                                      }
                                      
                                      else {
                                      document.querySelector(activePlayer['scoreSpan']).textContent = activePlayer['score'];
                                      }
                                      
                                      }
                                      
                                      function dealerLogic() {
                                      let card = randomCard();
                                      showCard(card, DEALER);
                                      updateScore(card, DEALER);
                                      showScore(DEALER);
                                      
                                      
                                      
                                      
                                      }
                                      
                                      function computeWinner() {
                                          let winner;
                                      
                                      if (YOU['score'] <= 21) {
                                      if (YOU['score'] > DEALER['score'] || (DEALER)['score'] > 21) {
                                      console.log('You won');
                                      winner = YOU;
                                      
                                      } else if (YOU['score'] < DEALER['score']) {
                                          console.log('You lost');
                                          winner = DEALER;
                                      
                                      } else if (YOU['score'] === DEALER['score']) {
                                          console.log('You drew');
                                      }
                                      
                                      } else if (YOU['score'] > 21 && DEALER['score'] <= 21) {
                                          console.log('You lost');
                                          winner = DEALER;
                                      
                                      } else if (YOU['score'] > 21 && DEALER['score'] > 21) {
                                          console.log('You drew');
                                      
                                      }
                                      
                                      return winner;
                                      }
                                      
                                      function showResult(winner) {
                                      console.log('Winner is', winner);
                                          let message, messageColor;
                                          
                                          if (winner === YOU) {
                                          message = 'You won';
                                          messageColor = 'green';
                                          winSound.play();
                                          
                                      
                                      
                                      } else if (winner === DEALER) {
                                          message = 'You lost';
                                          messageColor = 'red';
                                          lossSound.play();
                                      
                                      } else {
                                          message = 'You drew';
                                          messageColor = 'black';
                                      }
                                      
                                      document.querySelector('#blackjack-result').textContent = message;
                                      document.querySelector('#blackjack-result').style.color = messageColor;
                                      
                                      
                                      
                                      }
                                          .flex-blackjack-row-1, .flex-blackjack-row-2 
                                      {
                                      display: flex;
                                      border: 1px solid black;
                                      padding: 10px;
                                      flex-wrap: wrap;
                                      flex-direction: row;
                                      justify-content: space-around;
                                      color: #ffffff;
                                      background: url('https://image.freepik.com/free-vector/poker-table-background-green-color_47243-1068.jpg') center;}
                                      
                                      
                                      .flex-blackjack-row-3 {
                                      
                                          display: flex;
                                          border: 1px solid black;
                                          padding: 10px;
                                          flex-wrap: wrap;
                                          flex-direction: row;
                                          justify-content: space-around;    
                                      
                                      }
                                      
                                      
                                      .flex-blackjack-row-1 div {
                                      
                                      border: 1px solid black;
                                      padding: 10px;
                                      height: 350px;
                                      text-align: center;
                                      flex: 1;
                                      }
                                      
                                      .flex-blackjack-row-1 img {
                                      
                                          width: 25%;
                                          padding: 10px;
                                      }
                                      
                                      .flex-blackjack-row-2 button {
                                      
                                      border: 1px solid black;
                                      padding: 10px;
                                      }
                                      
                                      .flex-blackjack-row-2 div {
                                      
                                      border: 1px solid black;
                                      padding: 10px;
                                      }
                                      
                                      
                                      table, th, td {
                                      
                                      padding: 5px;
                                      border: 1px solid black;
                                      
                                      }
                                      
                                      
                                      
                                      
                                      
                                      
                                      .flex-blackjack-row-2 {
                                          display: flex;
                                      border: 1px solid black;
                                      padding: 10px;
                                      flex-wrap: wrap;
                                      flex-direction: row;
                                      justify-content: space-around;
                                      }
                                      <div class="container-5"> 
                                      
                                      <h2>Blackjack Challenge</h2>
                                      <h3><span id="blackjack-result">Let's Play</span></h3>
                                      
                                      <div class="flex-blackjack-row-1">
                                          <div id="your-box">
                                              <h2>You: <span id="your-blackjack-result">0</span></h2>
                                          </div>
                                      <div id="dealer-box">
                                          <h2>Dealer: <span id="dealer-blackjack-result">0</span></h2>
                                      </div>
                                      </div>
                                      <div class="flex-blackjack-row-2">
                                          <button class="btn-lg btn-primary mr-2" id="blackjack-hit-button">Hit</button>
                                          <button class="btn-lg btn-warning mr-2" id="blackjack-stand-button">Stand</button>
                                          <button class="btn-lg btn-danger mr-2" id="blackjack-deal-button">Deal</button>
                                      </div>
                                      
                                      
                                      <div class="flex-blackjack-row-3">
                                         
                                          <table>
                                              <tr>
                                                  <th>Wins</th>
                                                  <th>Losses</th>
                                                  <th>Draws</th>
                                              </tr>
                                      
                                      <tr>
                                          <td><span id="wins">0</span></td>
                                          <td><span id="losses">0</span></td>
                                          <td><span id="draws">0</span></td>
                                          
                                      </tr>
                                      
                                          </table>
                                      
                                      </div>
                                      
                                      
                                      </div>
                                          //Challenge 5: Blackjack
                                      
                                      let blackjackGame = {
                                      
                                      'dealer': {'scoreSpan': '#dealer-blackjack-result', 'div': '#dealer-box', 'score': 0},  
                                      'you': {'scoreSpan': '#your-blackjack-result', 'div': '#your-box', 'score': 0},   
                                      'cards': ['2', '3', '4', '5', '6', '7', '8', '9', '10', 'K', 'J', 'Q', 'A'],
                                      'cardsMap': {'2': 2, '3': 3, '4': 4, '5': 5, '6': 6, '7': 7, '8': 8, '9': 9, '10': 10, 'K': 10, 'J': 10, 'Q': 10, 'A': [1, 11]}
                                      
                                      };
                                      
                                      
                                      const YOU = blackjackGame['you']
                                      const DEALER = blackjackGame['dealer']
                                      
                                      const hitSound = new Audio('static/sounds/swish.m4a');
                                      const winSound = new Audio('static/sounds/cash.mp3');
                                      const lossSound = new Audio('static/sounds/aww.mp3');
                                      
                                      document.querySelector('#blackjack-hit-button').addEventListener('click', blackjackHit);
                                      document.querySelector('#blackjack-stand-button').addEventListener('click', dealerLogic);
                                      document.querySelector('#blackjack-deal-button').addEventListener('click', blackjackDeal);
                                      
                                      function blackjackHit() {
                                      let card = randomCard();
                                      showCard(card, YOU);
                                      updateScore(card, YOU);
                                      showScore(YOU);}
                                      
                                      
                                      function randomCard() {
                                          let randomIndex = Math.floor(Math.random() * 13);
                                          return blackjackGame['cards'][randomIndex];
                                          }
                                      
                                      
                                      function showCard(card, activePlayer) {
                                          if (activePlayer['score'] <= 21) {
                                          let cardImage = document.createElement('img');
                                          cardImage.src = `static/images/${card}.png`;
                                          document.querySelector(activePlayer['div']).appendChild(cardImage);
                                          hitSound.play(); }  
                                      }
                                      
                                      function blackjackDeal() {
                                      
                                          
                                          showResult(computeWinner());
                                          let yourImages = document.querySelector('#your-box').querySelectorAll('img');
                                          let dealerImages = document.querySelector('#dealer-box').querySelectorAll('img');
                                          
                                      
                                          for (i=0; i < yourImages.length; i++) {
                                              yourImages[i].remove();
                                          }
                                      
                                      
                                          for (i=0; i < dealerImages.length; i++) {
                                              dealerImages[i].remove();
                                          }
                                      
                                      YOU['score'] = 0;
                                      DEALER['score'] = 0;
                                      
                                      document.querySelector('#your-blackjack-result').textContent = 0;
                                      document.querySelector('#your-blackjack-result').style.color = 'white';
                                      
                                      document.querySelector('#dealer-blackjack-result').textContent = 0;
                                      document.querySelector('#dealer-blackjack-result').style.color = 'white';
                                      }
                                      
                                      function updateScore(card, activePlayer) {
                                      
                                      
                                      if (card === 'A') {
                                      
                                          if (activePlayer['score'] + blackjackGame['cardsMap'][card][1] <= 21) {
                                      activePlayer['score'] += blackjackGame['cardsMap'][card][1];
                                      
                                      }  else { 
                                      
                                      activePlayer['score'] += blackjackGame['cardsMap'][card][0];}
                                      
                                      
                                      
                                      } else {
                                      
                                      activePlayer['score'] += blackjackGame['cardsMap'][card];
                                      }
                                      }
                                      
                                      function showScore(activePlayer) {
                                      
                                      if (activePlayer['score'] > 21) {
                                          document.querySelector(activePlayer['scoreSpan']).textContent = 'BUST!';
                                          document.querySelector(activePlayer['scoreSpan']).style.color = 'red';
                                          
                                      }
                                      
                                      else {
                                      document.querySelector(activePlayer['scoreSpan']).textContent = activePlayer['score'];
                                      }
                                      
                                      }
                                      
                                      function dealerLogic() {
                                      let card = randomCard();
                                      showCard(card, DEALER);
                                      updateScore(card, DEALER);
                                      showScore(DEALER);
                                      
                                      
                                      
                                      
                                      }
                                      
                                      function computeWinner() {
                                          let winner;
                                      
                                      if (YOU['score'] <= 21) {
                                      if (YOU['score'] > DEALER['score'] || (DEALER)['score'] > 21) {
                                      console.log('You won');
                                      winner = YOU;
                                      
                                      } else if (YOU['score'] < DEALER['score']) {
                                          console.log('You lost');
                                          winner = DEALER;
                                      
                                      } else if (YOU['score'] === DEALER['score']) {
                                          console.log('You drew');
                                      }
                                      
                                      } else if (YOU['score'] > 21 && DEALER['score'] <= 21) {
                                          console.log('You lost');
                                          winner = DEALER;
                                      
                                      } else if (YOU['score'] > 21 && DEALER['score'] > 21) {
                                          console.log('You drew');
                                      
                                      }
                                      
                                      return winner;
                                      }
                                      
                                      function showResult(winner) {
                                      console.log('Winner is', winner);
                                          let message, messageColor;
                                          
                                          if (winner === YOU) {
                                          message = 'You won';
                                          messageColor = 'green';
                                          winSound.play();
                                          
                                      
                                      
                                      } else if (winner === DEALER) {
                                          message = 'You lost';
                                          messageColor = 'red';
                                          lossSound.play();
                                      
                                      } else {
                                          message = 'You drew';
                                          messageColor = 'black';
                                      }
                                      
                                      document.querySelector('#blackjack-result').textContent = message;
                                      document.querySelector('#blackjack-result').style.color = messageColor;
                                      
                                      
                                      
                                      }
                                          .flex-blackjack-row-1, .flex-blackjack-row-2 
                                      {
                                      display: flex;
                                      border: 1px solid black;
                                      padding: 10px;
                                      flex-wrap: wrap;
                                      flex-direction: row;
                                      justify-content: space-around;
                                      color: #ffffff;
                                      background: url('https://image.freepik.com/free-vector/poker-table-background-green-color_47243-1068.jpg') center;}
                                      
                                      
                                      .flex-blackjack-row-3 {
                                      
                                          display: flex;
                                          border: 1px solid black;
                                          padding: 10px;
                                          flex-wrap: wrap;
                                          flex-direction: row;
                                          justify-content: space-around;    
                                      
                                      }
                                      
                                      
                                      .flex-blackjack-row-1 div {
                                      
                                      border: 1px solid black;
                                      padding: 10px;
                                      height: 350px;
                                      text-align: center;
                                      flex: 1;
                                      }
                                      
                                      .flex-blackjack-row-1 img {
                                      
                                          width: 25%;
                                          padding: 10px;
                                      }
                                      
                                      .flex-blackjack-row-2 button {
                                      
                                      border: 1px solid black;
                                      padding: 10px;
                                      }
                                      
                                      .flex-blackjack-row-2 div {
                                      
                                      border: 1px solid black;
                                      padding: 10px;
                                      }
                                      
                                      
                                      table, th, td {
                                      
                                      padding: 5px;
                                      border: 1px solid black;
                                      
                                      }
                                      
                                      
                                      
                                      
                                      
                                      
                                      .flex-blackjack-row-2 {
                                          display: flex;
                                      border: 1px solid black;
                                      padding: 10px;
                                      flex-wrap: wrap;
                                      flex-direction: row;
                                      justify-content: space-around;
                                      }
                                      <div class="container-5"> 
                                      
                                      <h2>Blackjack Challenge</h2>
                                      <h3><span id="blackjack-result">Let's Play</span></h3>
                                      
                                      <div class="flex-blackjack-row-1">
                                          <div id="your-box">
                                              <h2>You: <span id="your-blackjack-result">0</span></h2>
                                          </div>
                                      <div id="dealer-box">
                                          <h2>Dealer: <span id="dealer-blackjack-result">0</span></h2>
                                      </div>
                                      </div>
                                      <div class="flex-blackjack-row-2">
                                          <button class="btn-lg btn-primary mr-2" id="blackjack-hit-button">Hit</button>
                                          <button class="btn-lg btn-warning mr-2" id="blackjack-stand-button">Stand</button>
                                          <button class="btn-lg btn-danger mr-2" id="blackjack-deal-button">Deal</button>
                                      </div>
                                      
                                      
                                      <div class="flex-blackjack-row-3">
                                         
                                          <table>
                                              <tr>
                                                  <th>Wins</th>
                                                  <th>Losses</th>
                                                  <th>Draws</th>
                                              </tr>
                                      
                                      <tr>
                                          <td><span id="wins">0</span></td>
                                          <td><span id="losses">0</span></td>
                                          <td><span id="draws">0</span></td>
                                          
                                      </tr>
                                      
                                          </table>
                                      
                                      </div>
                                      
                                      
                                      </div>

                                      Search filter for PokeAPI

                                      copy iconCopydownload iconDownload
                                      const PokemonContainer = document.getElementById("pokemon__containerID");
                                      const SearchContainer = document.getElementById("search__containerID");
                                      
                                      const SearchElement = document.createElement("input");
                                      SearchElement.setAttribute("type", "text");
                                      SearchElement.setAttribute("name", "searchBar");
                                      SearchElement.setAttribute("placeholder", "Search...");
                                      SearchContainer.appendChild(SearchElement);
                                      
                                      const PokemonNumber = 10;
                                      
                                      const createPokemonCard = (pokemon) => {
                                        const PokemonElement = document.createElement("div");
                                        const PokemonName = pokemon.name[0].toUpperCase() + pokemon.name.slice(1);
                                        PokemonElement.setAttribute("id", PokemonName);
                                        const PokemonID = pokemon.id;
                                        const PokemonType = pokemon.types[0].type.name;
                                        const PokemonTypeColors = {
                                          fire: "#EE8130",
                                          grass: "#7AC74C",
                                          eletric: "#F7D02C",
                                          water: "#6390F0",
                                          ground: "#E2BF65",
                                          rock: "#B6A136",
                                          fairy: "#D685AD",
                                          poison: "#A33EA1",
                                          bug: "#A6B91A",
                                          dragon: "#6F35FC",
                                          psychic: "#F95587",
                                          flying: "#A98FF3",
                                          fighting: "#C22E28",
                                          normal: "#A8A77A",
                                          ice: "#96D9D6",
                                          ghost: "#735797",
                                          dark: "#705746",
                                          steel: "#B7B7CE",
                                        };
                                        const AddColors = PokemonTypeColors[PokemonType];
                                        PokemonElement.style.backgroundColor = AddColors;
                                        const PokemonInnerHTML = `
                                          <div class="pokemon__imageContainer" id="${PokemonName}">
                                            <img src="https://pokeres.bastionbot.org/images/pokemon/${PokemonID}.png" />
                                          </div>
                                          <div class="pokemon__infomationContainer">
                                            <span class="pokemon__id">#${PokemonID.toString().padStart(3, "0")}</span>
                                            <h3 class="pokemon__name">${PokemonName}</h3>
                                            <small class="pokemon__type">Type: <span>${PokemonType}</span></small>
                                          </div>`;
                                        PokemonElement.setAttribute("class", "pokemon__card");
                                        PokemonElement.innerHTML = PokemonInnerHTML;
                                        PokemonContainer.appendChild(PokemonElement);
                                      };
                                      
                                      const getPokemons = async (id) => {
                                        const api_url = `https://pokeapi.co/api/v2/pokemon/${id}`;
                                        const response = await fetch(api_url);
                                        const data = await response.json();
                                        createPokemonCard(data);
                                      };
                                      
                                      const receivePokemons = async () => {
                                        for (let item = 1; item <= PokemonNumber; item++) {
                                          await getPokemons(item);
                                        }
                                        createSearchFilter();
                                      };
                                      
                                      receivePokemons();
                                      
                                      const createSearchFilter = (pokemonData) => {
                                        const cards = document.querySelectorAll(".pokemon__card");
                                        SearchElement.addEventListener("keyup", (event) => {
                                          const val = event.target.value.toLowerCase();
                                          cards.forEach((card) => {
                                            if (card.id.toLowerCase().includes(val)) {
                                              card.style.display = "block";
                                            } else {
                                              card.style.display = "none";
                                            }
                                          });
                                        });
                                      };
                                      @import url('https://fonts.googleapis.com/css2?family=Lato:ital,wght@0,100;0,300;0,400;0,700;0,900;1,100;1,300;1,400;1,700;1,900&display=swap');
                                      
                                      * {
                                        margin: 0;
                                        padding: 0;
                                        box-sizing: border-box;
                                      }
                                      
                                      body {
                                        background: #efefbb;
                                        background: -webkit-linear-gradient(to right, #d4d3dd, #efefbb);
                                        background: linear-gradient(to right, #d4d3dd, #efefbb);
                                        display: flex;
                                        flex-direction: column;
                                        align-items: center;
                                        justify-content: center;
                                        font-family: 'Lato';
                                      }
                                      
                                      h1 {
                                        letter-spacing: 3px;
                                      }
                                      
                                      .pokemon__container {
                                        display: flex;
                                        flex-wrap: wrap;
                                        justify-content: center;
                                        align-items: space-between;
                                        max-width: 100vw;
                                      }
                                      
                                      .pokemon__card {
                                        background: #eeeeee;
                                        border-radius: 20px;
                                        padding: 20px 40px;
                                        margin: 10px;
                                        box-shadow: 0 3px 15px rgba(100, 100, 100, 0.6);
                                      }
                                      
                                      .pokemon__imageContainer {
                                        margin-top: 20px;
                                        width: 120px;
                                        height: 120px;
                                      }
                                      
                                      .pokemon__imageContainer img {
                                        width: 100%;
                                      }
                                      
                                      .pokemon__infomationContainer {
                                        margin-top: 20px;
                                        text-align: center;
                                      }
                                      
                                      .pokemon__id {
                                        background: #ffffff80;
                                        border-radius: 10px;
                                        font-size: 1rem;
                                        padding: 5px 10px;
                                      }
                                      
                                      .pokemon__name {
                                        margin: 15px 0 7px 0;
                                        letter-spacing: 1px;
                                      }
                                      <!DOCTYPE html>
                                      <html lang="en">
                                      
                                      <head>
                                        <meta charset="UTF-8" />
                                        <meta http-equiv="X-UA-Compatible" content="IE=edge" />
                                        <meta name="viewport" content="width=device-width, initial-scale=1.0" />
                                        <title>Document</title>
                                        <script src="function.js" defer></script>
                                        <link rel="stylesheet" href="style.css" />
                                      </head>
                                      
                                      <body>
                                        <h1>PokeDex</h1>
                                        <div class="search__container" id="search__containerID"></div>
                                        <div class="pokemon__container" id="pokemon__containerID"></div>
                                      </body>
                                      
                                      </html>
                                      const PokemonContainer = document.getElementById("pokemon__containerID");
                                      const SearchContainer = document.getElementById("search__containerID");
                                      
                                      const SearchElement = document.createElement("input");
                                      SearchElement.setAttribute("type", "text");
                                      SearchElement.setAttribute("name", "searchBar");
                                      SearchElement.setAttribute("placeholder", "Search...");
                                      SearchContainer.appendChild(SearchElement);
                                      
                                      const PokemonNumber = 10;
                                      
                                      const createPokemonCard = (pokemon) => {
                                        const PokemonElement = document.createElement("div");
                                        const PokemonName = pokemon.name[0].toUpperCase() + pokemon.name.slice(1);
                                        PokemonElement.setAttribute("id", PokemonName);
                                        const PokemonID = pokemon.id;
                                        const PokemonType = pokemon.types[0].type.name;
                                        const PokemonTypeColors = {
                                          fire: "#EE8130",
                                          grass: "#7AC74C",
                                          eletric: "#F7D02C",
                                          water: "#6390F0",
                                          ground: "#E2BF65",
                                          rock: "#B6A136",
                                          fairy: "#D685AD",
                                          poison: "#A33EA1",
                                          bug: "#A6B91A",
                                          dragon: "#6F35FC",
                                          psychic: "#F95587",
                                          flying: "#A98FF3",
                                          fighting: "#C22E28",
                                          normal: "#A8A77A",
                                          ice: "#96D9D6",
                                          ghost: "#735797",
                                          dark: "#705746",
                                          steel: "#B7B7CE",
                                        };
                                        const AddColors = PokemonTypeColors[PokemonType];
                                        PokemonElement.style.backgroundColor = AddColors;
                                        const PokemonInnerHTML = `
                                          <div class="pokemon__imageContainer" id="${PokemonName}">
                                            <img src="https://pokeres.bastionbot.org/images/pokemon/${PokemonID}.png" />
                                          </div>
                                          <div class="pokemon__infomationContainer">
                                            <span class="pokemon__id">#${PokemonID.toString().padStart(3, "0")}</span>
                                            <h3 class="pokemon__name">${PokemonName}</h3>
                                            <small class="pokemon__type">Type: <span>${PokemonType}</span></small>
                                          </div>`;
                                        PokemonElement.setAttribute("class", "pokemon__card");
                                        PokemonElement.innerHTML = PokemonInnerHTML;
                                        PokemonContainer.appendChild(PokemonElement);
                                      };
                                      
                                      const getPokemons = async (id) => {
                                        const api_url = `https://pokeapi.co/api/v2/pokemon/${id}`;
                                        const response = await fetch(api_url);
                                        const data = await response.json();
                                        createPokemonCard(data);
                                      };
                                      
                                      const receivePokemons = async () => {
                                        for (let item = 1; item <= PokemonNumber; item++) {
                                          await getPokemons(item);
                                        }
                                        createSearchFilter();
                                      };
                                      
                                      receivePokemons();
                                      
                                      const createSearchFilter = (pokemonData) => {
                                        const cards = document.querySelectorAll(".pokemon__card");
                                        SearchElement.addEventListener("keyup", (event) => {
                                          const val = event.target.value.toLowerCase();
                                          cards.forEach((card) => {
                                            if (card.id.toLowerCase().includes(val)) {
                                              card.style.display = "block";
                                            } else {
                                              card.style.display = "none";
                                            }
                                          });
                                        });
                                      };
                                      @import url('https://fonts.googleapis.com/css2?family=Lato:ital,wght@0,100;0,300;0,400;0,700;0,900;1,100;1,300;1,400;1,700;1,900&display=swap');
                                      
                                      * {
                                        margin: 0;
                                        padding: 0;
                                        box-sizing: border-box;
                                      }
                                      
                                      body {
                                        background: #efefbb;
                                        background: -webkit-linear-gradient(to right, #d4d3dd, #efefbb);
                                        background: linear-gradient(to right, #d4d3dd, #efefbb);
                                        display: flex;
                                        flex-direction: column;
                                        align-items: center;
                                        justify-content: center;
                                        font-family: 'Lato';
                                      }
                                      
                                      h1 {
                                        letter-spacing: 3px;
                                      }
                                      
                                      .pokemon__container {
                                        display: flex;
                                        flex-wrap: wrap;
                                        justify-content: center;
                                        align-items: space-between;
                                        max-width: 100vw;
                                      }
                                      
                                      .pokemon__card {
                                        background: #eeeeee;
                                        border-radius: 20px;
                                        padding: 20px 40px;
                                        margin: 10px;
                                        box-shadow: 0 3px 15px rgba(100, 100, 100, 0.6);
                                      }
                                      
                                      .pokemon__imageContainer {
                                        margin-top: 20px;
                                        width: 120px;
                                        height: 120px;
                                      }
                                      
                                      .pokemon__imageContainer img {
                                        width: 100%;
                                      }
                                      
                                      .pokemon__infomationContainer {
                                        margin-top: 20px;
                                        text-align: center;
                                      }
                                      
                                      .pokemon__id {
                                        background: #ffffff80;
                                        border-radius: 10px;
                                        font-size: 1rem;
                                        padding: 5px 10px;
                                      }
                                      
                                      .pokemon__name {
                                        margin: 15px 0 7px 0;
                                        letter-spacing: 1px;
                                      }
                                      <!DOCTYPE html>
                                      <html lang="en">
                                      
                                      <head>
                                        <meta charset="UTF-8" />
                                        <meta http-equiv="X-UA-Compatible" content="IE=edge" />
                                        <meta name="viewport" content="width=device-width, initial-scale=1.0" />
                                        <title>Document</title>
                                        <script src="function.js" defer></script>
                                        <link rel="stylesheet" href="style.css" />
                                      </head>
                                      
                                      <body>
                                        <h1>PokeDex</h1>
                                        <div class="search__container" id="search__containerID"></div>
                                        <div class="pokemon__container" id="pokemon__containerID"></div>
                                      </body>
                                      
                                      </html>
                                      const PokemonContainer = document.getElementById("pokemon__containerID");
                                      const SearchContainer = document.getElementById("search__containerID");
                                      
                                      const SearchElement = document.createElement("input");
                                      SearchElement.setAttribute("type", "text");
                                      SearchElement.setAttribute("name", "searchBar");
                                      SearchElement.setAttribute("placeholder", "Search...");
                                      SearchContainer.appendChild(SearchElement);
                                      
                                      const PokemonNumber = 10;
                                      
                                      const createPokemonCard = (pokemon) => {
                                        const PokemonElement = document.createElement("div");
                                        const PokemonName = pokemon.name[0].toUpperCase() + pokemon.name.slice(1);
                                        PokemonElement.setAttribute("id", PokemonName);
                                        const PokemonID = pokemon.id;
                                        const PokemonType = pokemon.types[0].type.name;
                                        const PokemonTypeColors = {
                                          fire: "#EE8130",
                                          grass: "#7AC74C",
                                          eletric: "#F7D02C",
                                          water: "#6390F0",
                                          ground: "#E2BF65",
                                          rock: "#B6A136",
                                          fairy: "#D685AD",
                                          poison: "#A33EA1",
                                          bug: "#A6B91A",
                                          dragon: "#6F35FC",
                                          psychic: "#F95587",
                                          flying: "#A98FF3",
                                          fighting: "#C22E28",
                                          normal: "#A8A77A",
                                          ice: "#96D9D6",
                                          ghost: "#735797",
                                          dark: "#705746",
                                          steel: "#B7B7CE",
                                        };
                                        const AddColors = PokemonTypeColors[PokemonType];
                                        PokemonElement.style.backgroundColor = AddColors;
                                        const PokemonInnerHTML = `
                                          <div class="pokemon__imageContainer" id="${PokemonName}">
                                            <img src="https://pokeres.bastionbot.org/images/pokemon/${PokemonID}.png" />
                                          </div>
                                          <div class="pokemon__infomationContainer">
                                            <span class="pokemon__id">#${PokemonID.toString().padStart(3, "0")}</span>
                                            <h3 class="pokemon__name">${PokemonName}</h3>
                                            <small class="pokemon__type">Type: <span>${PokemonType}</span></small>
                                          </div>`;
                                        PokemonElement.setAttribute("class", "pokemon__card");
                                        PokemonElement.innerHTML = PokemonInnerHTML;
                                        PokemonContainer.appendChild(PokemonElement);
                                      };
                                      
                                      const getPokemons = async (id) => {
                                        const api_url = `https://pokeapi.co/api/v2/pokemon/${id}`;
                                        const response = await fetch(api_url);
                                        const data = await response.json();
                                        createPokemonCard(data);
                                      };
                                      
                                      const receivePokemons = async () => {
                                        for (let item = 1; item <= PokemonNumber; item++) {
                                          await getPokemons(item);
                                        }
                                        createSearchFilter();
                                      };
                                      
                                      receivePokemons();
                                      
                                      const createSearchFilter = (pokemonData) => {
                                        const cards = document.querySelectorAll(".pokemon__card");
                                        SearchElement.addEventListener("keyup", (event) => {
                                          const val = event.target.value.toLowerCase();
                                          cards.forEach((card) => {
                                            if (card.id.toLowerCase().includes(val)) {
                                              card.style.display = "block";
                                            } else {
                                              card.style.display = "none";
                                            }
                                          });
                                        });
                                      };
                                      @import url('https://fonts.googleapis.com/css2?family=Lato:ital,wght@0,100;0,300;0,400;0,700;0,900;1,100;1,300;1,400;1,700;1,900&display=swap');
                                      
                                      * {
                                        margin: 0;
                                        padding: 0;
                                        box-sizing: border-box;
                                      }
                                      
                                      body {
                                        background: #efefbb;
                                        background: -webkit-linear-gradient(to right, #d4d3dd, #efefbb);
                                        background: linear-gradient(to right, #d4d3dd, #efefbb);
                                        display: flex;
                                        flex-direction: column;
                                        align-items: center;
                                        justify-content: center;
                                        font-family: 'Lato';
                                      }
                                      
                                      h1 {
                                        letter-spacing: 3px;
                                      }
                                      
                                      .pokemon__container {
                                        display: flex;
                                        flex-wrap: wrap;
                                        justify-content: center;
                                        align-items: space-between;
                                        max-width: 100vw;
                                      }
                                      
                                      .pokemon__card {
                                        background: #eeeeee;
                                        border-radius: 20px;
                                        padding: 20px 40px;
                                        margin: 10px;
                                        box-shadow: 0 3px 15px rgba(100, 100, 100, 0.6);
                                      }
                                      
                                      .pokemon__imageContainer {
                                        margin-top: 20px;
                                        width: 120px;
                                        height: 120px;
                                      }
                                      
                                      .pokemon__imageContainer img {
                                        width: 100%;
                                      }
                                      
                                      .pokemon__infomationContainer {
                                        margin-top: 20px;
                                        text-align: center;
                                      }
                                      
                                      .pokemon__id {
                                        background: #ffffff80;
                                        border-radius: 10px;
                                        font-size: 1rem;
                                        padding: 5px 10px;
                                      }
                                      
                                      .pokemon__name {
                                        margin: 15px 0 7px 0;
                                        letter-spacing: 1px;
                                      }
                                      <!DOCTYPE html>
                                      <html lang="en">
                                      
                                      <head>
                                        <meta charset="UTF-8" />
                                        <meta http-equiv="X-UA-Compatible" content="IE=edge" />
                                        <meta name="viewport" content="width=device-width, initial-scale=1.0" />
                                        <title>Document</title>
                                        <script src="function.js" defer></script>
                                        <link rel="stylesheet" href="style.css" />
                                      </head>
                                      
                                      <body>
                                        <h1>PokeDex</h1>
                                        <div class="search__container" id="search__containerID"></div>
                                        <div class="pokemon__container" id="pokemon__containerID"></div>
                                      </body>
                                      
                                      </html>

                                      Removing duplicates interpreted according to a pattern, fails

                                      copy iconCopydownload iconDownload
                                      awk '{sub(/^\([^)]+\) */, "")} match($0, /^[a-zA-Z][a-zA-Z\047]*( +[a-zA-Z\047]+)*/) {s = substr($0, 1, RLENGTH); unq[tolower(s)]=s} END {for (i in unq) print unq[i]}' file.txt
                                      
                                      Il segno di Zorro Serie d'oro
                                      L'Uomo Mascherato
                                      Il mondo di Arkadi
                                      Il piccolo sceriffo
                                      Le leggende di Batman
                                      Corna vissute
                                      Il segno di Zorro
                                      Genius
                                      
                                      awk '
                                      {sub(/^\([^)]+\) */, "")}
                                      match($0, /^[a-zA-Z][a-zA-Z\047]*( +[a-zA-Z\047]+)*/) {
                                         s = substr($0, 1, RLENGTH)
                                         unq[tolower(s)] = s
                                      }
                                      END {
                                         for (i in unq)
                                            print unq[i]
                                      }' file.txt
                                      
                                      awk '{sub(/^\([^)]+\) */, "")} match($0, /^[a-zA-Z][a-zA-Z\047]*( +[a-zA-Z\047]+)*/) {s = substr($0, 1, RLENGTH); unq[tolower(s)]=s} END {for (i in unq) print unq[i]}' file.txt
                                      
                                      Il segno di Zorro Serie d'oro
                                      L'Uomo Mascherato
                                      Il mondo di Arkadi
                                      Il piccolo sceriffo
                                      Le leggende di Batman
                                      Corna vissute
                                      Il segno di Zorro
                                      Genius
                                      
                                      awk '
                                      {sub(/^\([^)]+\) */, "")}
                                      match($0, /^[a-zA-Z][a-zA-Z\047]*( +[a-zA-Z\047]+)*/) {
                                         s = substr($0, 1, RLENGTH)
                                         unq[tolower(s)] = s
                                      }
                                      END {
                                         for (i in unq)
                                            print unq[i]
                                      }' file.txt
                                      
                                      sed -E 's/(^[^0-9\-\.\[\…\-]* ?).*/\1/' input | sort -u
                                      

                                      Running multiple &quot;if&quot; statements, but multiple are met at a time

                                      copy iconCopydownload iconDownload
                                      def get_fruit(fruit):
                                        if fruit == 'apple':
                                          print('This should not be compared.')
                                        elif fruit == 'banana':
                                          print('What sort of monkey business is this?')
                                        else:
                                          print('Orange you glad you did not say banana?')
                                      
                                      >>> get_fruit('banana')
                                      What sort of monkey business is this?
                                      
                                      >>> get_fruit('mango')
                                      Orange you glad you did not say banana?
                                      
                                      >>> get_fruit('apple')
                                      This should not be compared.
                                      

                                      Cannot read whole file through fs.readFile() in nodejs

                                      copy iconCopydownload iconDownload
                                      0000000 6570 6d72 6c61 6e69 2c6b 6f63 706d 6e61
                                      0000010 2c79 756e 456d 706d 2c73 6163 6574 6f67
                                      0000020 7972 632c 7469 2c79 7473 7461 2c65 7566
                                      0000030 646e 6465 6144 6574 722c 6961 6573 4164
                                      0000040 746d 722c 6961 6573 4364 7275 6572 636e
                                      0000050 2c79 6f72 6e75 0d64 696c 6566 6f6c 6b63
                                                             ^^ carriage return
                                      0000060 4c2c 6669 4c65 636f 2c6b 772c 6265 542c
                                      
                                      async function temp(){
                                          let data = await test()
                                          let lines = data.split('\r')
                                          lines.forEach(line => console.log(line))
                                      }
                                      
                                      0000000 6570 6d72 6c61 6e69 2c6b 6f63 706d 6e61
                                      0000010 2c79 756e 456d 706d 2c73 6163 6574 6f67
                                      0000020 7972 632c 7469 2c79 7473 7461 2c65 7566
                                      0000030 646e 6465 6144 6574 722c 6961 6573 4164
                                      0000040 746d 722c 6961 6573 4364 7275 6572 636e
                                      0000050 2c79 6f72 6e75 0d64 696c 6566 6f6c 6b63
                                                             ^^ carriage return
                                      0000060 4c2c 6669 4c65 636f 2c6b 772c 6265 542c
                                      
                                      async function temp(){
                                          let data = await test()
                                          let lines = data.split('\r')
                                          lines.forEach(line => console.log(line))
                                      }
                                      

                                      Dynamically populate value of array in a Div

                                      copy iconCopydownload iconDownload
                                      for (let person = 0; person < number_of_people; person++) {
                                          $(".results").append(
                                              $("<p>").append(
                                                  `Person ${person+1}: `,
                                                  deck.splice(-Math.ceil(deck.length / (number_of_people - person))).map(card =>
                                                      `${card.cardTypes}-${card.cardValue}`
                                                  ).join(", ")
                                              )
                                          );
                                      }
                                      
                                      if (number_of_people > 0 && number_of_people !== null) {
                                      
                                      var number_of_people = +document.getElementById("number_of_people").value;
                                      
                                      for (let person = 0; person < number_of_people; person++) {
                                          $(".results").append(
                                              $("<p>").append(
                                                  `Person ${person+1}: `,
                                                  deck.splice(-Math.ceil(deck.length / (number_of_people - person))).map(card =>
                                                      `${card.cardTypes}-${card.cardValue}`
                                                  ).join(", ")
                                              )
                                          );
                                      }
                                      
                                      if (number_of_people > 0 && number_of_people !== null) {
                                      
                                      var number_of_people = +document.getElementById("number_of_people").value;
                                      
                                      for (let person = 0; person < number_of_people; person++) {
                                          $(".results").append(
                                              $("<p>").append(
                                                  `Person ${person+1}: `,
                                                  deck.splice(-Math.ceil(deck.length / (number_of_people - person))).map(card =>
                                                      `${card.cardTypes}-${card.cardValue}`
                                                  ).join(", ")
                                              )
                                          );
                                      }
                                      
                                      if (number_of_people > 0 && number_of_people !== null) {
                                      
                                      var number_of_people = +document.getElementById("number_of_people").value;
                                      

                                      See all related Code Snippets

                                      Community Discussions

                                      Trending Discussions on Poker
                                      • Video Poker How to make the combinations?
                                      • How to create global state with React Hooks [TypeScript]
                                      • How to generate 2,598,960 hands (efficient way) for poker game
                                      • Android Studio - I cannot see elements I made inside ScrollView, why?
                                      • How do you add a fixed sidebar inside an HTML/CSS Grid?
                                      • showResult function in blackjack not working
                                      • Search filter for PokeAPI
                                      • Removing duplicates interpreted according to a pattern, fails
                                      • Running multiple &quot;if&quot; statements, but multiple are met at a time
                                      • Cannot read whole file through fs.readFile() in nodejs
                                      Trending Discussions on Poker

                                      QUESTION

                                      Video Poker How to make the combinations?

                                      Asked 2021-Jun-03 at 12:52

                                      I have been stuck on this for quite a while. So I thought I'd look it up. But with hours of searching I have come to ask on stack overflow as I am completely stumped.

                                      Basically I am making a Web implementation of Jacks or Better: Video Poker. For some reason I keep getting my kings queen jacks and tens are recognized as the same value. And my full house keeps on being awarded. If my explanation isn't great then go to here or here to find out about the combinations.

                                      If I need to send more code like the style tag I can do so, but I think this is all that is necessary. Any help is appreciated even ways to shorten down my code!

                                          <div id="canvas">
                                              <form method="post" id="play">
                                                  <button>Play</button>
                                                  <input id="played" type="hidden" name="postType" value="play">
                                              </form>
                                              <div id="selected"></div>
                                              <div id="winScreen">TYPE OF WIN!</div>
                                              <div id="draw" onclick="draw()">DRAW</div>
                                              <form action="/games/poker" method="post">
                                                  <button id="reload" type="submit">
                                                      <svg xmlns="http://www.w3.org/2000/svg" width="50" height="50" fill="currentColor" class="bi bi-arrow-clockwise" viewBox="0 0 16 16">
                                                        <path fill-rule="evenodd" d="M8 3a5 5 0 1 0 4.546 2.914.5.5 0 0 1 .908-.417A6 6 0 1 1 8 2v1z"></path>
                                                        <path d="M8 4.466V.534a.25.25 0 0 1 .41-.192l2.36 1.966c.12.1.12.284 0 .384L8.41 4.658A.25.25 0 0 1 8 4.466z"></path>
                                                      </svg>
                                                    </button>
                                                    <input id="woned" type="hidden" name="postType" value="won">
                                                    <input id="who" type="hidden" name="won" value="None">
                                              </form>
                                              <div id="table"></div>
                                      
                                                      <table>
                                                          <thead>
                                                              <tr style="border-color:orange; border-width:2.5px;">
                                                                  <th>HAND</th>
                                                                  <th>WIN</th>
                                                              </tr>
                                                          </thead>
                                                          <tbody>
                                                              <tr>
                                                                  <td>ROYAL FLUSH</td>
                                                                  <td>$250</td>
                                                              </tr>
                                                              <tr>
                                                                  <td>Straight Flush</td>
                                                                  <td>$100</td>
                                                              </tr>
                                                              <tr>
                                                                  <td>Four of a Kind</td>
                                                                  <td>$75</td>
                                                              </tr>
                                                              <tr>
                                                                  <td>Full house </td>
                                                                  <td>$50</td>
                                                              </tr>
                                                              <tr>
                                                                  <td>Flush</td>
                                                                  <td>$25</td>
                                                              </tr>
                                                              <tr>
                                                                  <td>Straight</td>
                                                                  <td>$10</td>
                                                              </tr>
                                                              <tr>
                                                                  <td>Three of a Kind</td>
                                                                  <td>$5</td>
                                                              </tr>
                                                              <tr>
                                                                  <td>Two of a Kind</td>
                                                                  <td>$2</td>
                                                              </tr>
                                                              <tr>
                                                                  <td>Jacks or Better</td>
                                                                  <td>$1</td>
                                                              </tr>
                                                          </tbody>
                                                      </table>
                                              <div class="row stats">
                                                  <div class="col">
                                                      CASH: {{cash}}
                                                  </div>
                                                  <div class="col">
                                                      BET: {{bet}}
                                                  </div>
                                                  <div class="col">
                                                      WON: {{won}}
                                                  </div>
                                              </div>
                                              </div>
                                      </div>
                                      
                                      
                                      <script>
                                          let postType = "{{postType}}";
                                          var deck = [];
                                          let nummies = [];
                                          let numOfCards = 0;
                                          let cardsSel = [];
                                          function getCard(){
                                              let symbol = Math.floor(Math.random() * 4) + 1;
                                              let type = Math.floor(Math.random() * 13) + 1;
                                              if (symbol == 1){
                                                  symbol = "D";
                                              }
                                              else if (symbol == 2){
                                                  symbol = "S";
                                              }
                                              else if (symbol == 3){
                                                  symbol = "H";
                                              }
                                              else if (symbol == 4){
                                                  symbol = "C";
                                              }
                                      
                                              if (type == 1){
                                                  type = "A";
                                              }
                                              else if (type == 10){
                                                  type="T";
                                              }
                                              else if (type == 11){
                                                  type="J";
                                              }
                                              else if (type == 12){
                                                  type="Q";
                                              }
                                              else if (type == 13){
                                                  type="K";
                                              }
                                              let item = {type:"", symbol:""};
                                              item.type = type;
                                              item.symbol = symbol;
                                              return item;
                                          }
                                          function makeCard(){
                                              let card = getCard();
                                              card = card.type + card.symbol + ".png";
                                              while (containsObject(card, deck)){
                                                  card = getCard();
                                                  card = card.type + card.symbol + ".png";
                                              }
                                              deck.push(card);
                                              return card;
                                          }
                                          if (postType == "play"){
                                              document.querySelector("#play").style.visibility = "hidden";
                                              let images = [];
                                              for (var i = 0; i < 5; i++){
                                                  let card = makeCard();
                                                  images.push('<button id="noButton" onclick="selected(' + '\'' + card + '\'' + ', ' + i + ')"><img class="cards" src="' + '/static/deck/' + card + '"></button>');
                                              }
                                              document.querySelector("#table").innerHTML = images.join(" ");
                                          }
                                          function draw(){
                                              let images = [];
                                              for (var i = 0; i < 5 - numOfCards; i++){
                                                  let card = makeCard();
                                                  images.push('<button id="noButton"><img class="cards" src="' + '/static/deck/' + card + '"></button>');
                                                  cardsSel.push(card.slice(0, 2));
                                              }
                                              document.querySelector("#draw").style.visibility = "hidden";
                                              document.querySelector("#reload").style.visibility = "visible";
                                              images.push(document.querySelector("#selected").innerHTML);
                                              document.querySelector("#selected").innerHTML = "";
                                              document.querySelector("#table").innerHTML = images.join(" ");
                                      
                                              // WIN COMBINATIONS
                                      
                                              // ROYAL FLUSH
                                              if (containsObject("AH", cardsSel) && containsObject("KH", cardsSel) && containsObject("QH", cardsSel) && containsObject("JH", cardsSel) && containsObject("TH", cardsSel)){
                                                  winScreen("ROYAL FLUSH!");
                                              }
                                              else if (containsObject("AD", cardsSel) && containsObject("KD", cardsSel) && containsObject("QD", cardsSel) && containsObject("JD", cardsSel) && containsObject("TD", cardsSel)){
                                                  winScreen("ROYAL FLUSH!");
                                              }
                                              else if (containsObject("AS", cardsSel) && containsObject("KS", cardsSel) && containsObject("QS", cardsSel) && containsObject("JS", cardsSel) && containsObject("TS", cardsSel)){
                                                  winScreen("ROYAL FLUSH!");
                                              }
                                              else if (containsObject("AC", cardsSel) && containsObject("KC", cardsSel) && containsObject("QC", cardsSel) && containsObject("JC", cardsSel) && containsObject("TC", cardsSel)){
                                                  winScreen("ROYAL FLUSH!");
                                              }
                                              let numberList = [];
                                              for (i = 0; i < 5; i++){
                                                  let num = cardsSel[i][0];
                                                  if (num == "A"){
                                                      num = 1;
                                                  }
                                                  else if (num == "K"){
                                                      num = 11;
                                                  }
                                                  else if (num == "Q"){
                                                      num = 12;
                                                  }
                                                  else if (num == "J"){
                                                      num = 13;
                                                  }
                                                  else if (num == "T"){
                                                      num = 10;
                                                  }
                                                  else{
                                                      num = parseInt(num);
                                                  }
                                                  numberList += num
                                              }
                                              // STRAIGHT FLUSH
                                              let hPossible = 0;
                                              let dPossible = 0;
                                              let sPossible = 0;
                                              let cPossible = 0;
                                              let possible = false;
                                              for (i = 0; i < 5; i++){
                                                  if (cardsSel[i].indexOf("H") > -1){
                                                      hPossible += 1;
                                                  }
                                              }
                                              for (i = 0; i < 5; i++){
                                                  if (cardsSel[i].indexOf("D") > -1){
                                                      dPossible += 1;
                                                  }
                                              }
                                              for (i = 0; i < 5; i++){
                                                  if (cardsSel[i].indexOf("S") > -1){
                                                      sPossible += 1;
                                                  }
                                              }
                                              for (i = 0; i < 5; i++){
                                                  if (cardsSel[i].indexOf("C") > -1){
                                                      cPossible += 1;
                                                  }
                                              }
                                      
                                              if (hPossible == 5 || dPossible == 5 || sPossible == 5 || cPossible == 5){
                                                  possible = true;
                                              }
                                      
                                              if (possible == true){
                                                  let outcome = false;
                                                  let sorted = numberList.sort();
                                                  let count = 0;
                                      
                                                  for (i = 0; i < 5; i++){
                                                      if (sorted[i] + 1 == sorted[i+1]){
                                                          count += 1;
                                                      }
                                                  }
                                                  if (count == 5){
                                                      outcome = true;
                                                  }
                                      
                                                  if (outcome == true){
                                                      winScreen("STRAIGHT FLUSH!");
                                                  }
                                              }
                                      
                                              // Four of a Kind
                                      
                                              for (i = 0; i < 5; i++){
                                                  let selected = numberList[i];
                                                  if (countObjects(numberList, selected) == 4){
                                                      winScreen("Four of a Kind!");
                                                  }
                                              }
                                      
                                              // Full house
                                              possible = 0;
                                              for (i = 0; i < 5; i++){
                                                  let selected = numberList[i];
                                                  if (countObjects(numberList, selected) == 3){
                                                      possible += 1;
                                                  }
                                                  if (countObjects(numberList, selected) == 2){
                                                      possible += 1;
                                                  }
                                              }
                                              if (possible == 2){
                                                  winScreen("Full House!");
                                              }
                                      
                                              // Flush
                                              hPossible = 0;
                                              dPossible = 0;
                                              sPossible = 0;
                                              cPossible = 0;
                                              possible = false;
                                              for (i = 0; i < 5; i++){
                                                  if (cardsSel[i].indexOf("H") > -1){
                                                      hPossible += 1;
                                                  }
                                              }
                                              for (i = 0; i < 5; i++){
                                                  if (cardsSel[i].indexOf("D") > -1){
                                                      dPossible += 1;
                                                  }
                                              }
                                              for (i = 0; i < 5; i++){
                                                  if (cardsSel[i].indexOf("S") > -1){
                                                      sPossible += 1;
                                                  }
                                              }
                                              for (i = 0; i < 5; i++){
                                                  if (cardsSel[i].indexOf("C") > -1){
                                                      cPossible += 1;
                                                  }
                                              }
                                      
                                              if (hPossible == 5 || dPossible == 5 || sPossible == 5 || cPossible == 5){
                                                  possible = true;
                                              }
                                      
                                              if (possible == true){
                                                  winScreen("Flush!");
                                              }
                                      
                                              // Straight
                                              possible = false;
                                              let sorted = numberList.sort();
                                              let count = 0;
                                      
                                              for (i = 0; i < 5; i++){
                                                  if (sorted[i] + 1 == sorted[i+1]){
                                                      count += 1;
                                                  }
                                              }
                                              if (count == 5){
                                                  possible = true;
                                              }
                                      
                                              if (possible == true){
                                                  winScreen("STRAIGHT FLUSH!");
                                              }
                                      
                                              // WIN COMBINATIONS
                                      
                                          }
                                          function selected(card, num){
                                              if (containsObject(num, nummies) == false){
                                                  nummies.push(num);
                                                  document.querySelector("#selected").innerHTML += '<img class="cards" src="' + '/static/deck/' + card + '">';
                                                  numOfCards += 1;
                                                  cardsSel.push(card.slice(0, 2));
                                              }
                                          }
                                          function countObjects(list, object){
                                              var j = 0;
                                              for (i = 0; i < list.length; i++){
                                                  if (list[i] == object){
                                                      j++;
                                                  }
                                              }
                                              return j;
                                          }
                                          function winScreen(type){
                                              document.querySelector("#winScreen").style.visibility = "visible";
                                              document.querySelector("#winScreen").innerHTML = type;
                                          }
                                      
                                      
                                          // Borrowed Scripts
                                      
                                          //https://stackoverflow.com/a/4587130/14214193
                                          function containsObject(obj, list) {
                                              var i;
                                              for (i = 0; i < list.length; i++) {
                                                  if (list[i] === obj) {
                                                      return true;
                                                  }
                                      
                                              }
                                              return false;
                                          }
                                      </script>
                                      

                                      ANSWER

                                      Answered 2021-Jun-02 at 20:56

                                      I may be wrong, but you are first creating array:

                                      let numberList = [];
                                      

                                      and then instead of pushing into the array, you are incrementing numberList, so it's converted into string with added numbers. Screen below:

                                      consolelog incrementation

                                      Instead of

                                      numberList += num
                                      

                                      use

                                      numberList.push(num)
                                      

                                      so it adds number into the array, like in example below:

                                      example with array

                                      So now, your function countObjects will work properly. :) I'm not sure if it resolves your problem, but I'm sure it will help in current development and problem solving.

                                      //Edit: Added problem solve for Full House

                                      // Full house
                                          for (i = 0; i < 5; i++){
                                            possible = 0;
                                            let selected = numberList[i];
                                            if (countObjects(numberList, selected) == 3){
                                              possible += 1;
                                            }
                                            if (countObjects(numberList, selected) == 2){
                                              possible += 1;
                                            }
                                          }
                                          if (possible == 2){
                                            winScreen("Full House!");
                                          }
                                      

                                      Source https://stackoverflow.com/questions/67811042

                                      Community Discussions, Code Snippets contain sources that include Stack Exchange Network

                                      Vulnerabilities

                                      No vulnerabilities reported

                                      Install Poker

                                      You can download it from GitHub.
                                      You can use Poker like any standard Python library. You will need to make sure that you have a development environment consisting of a Python distribution including header files, a compiler, pip, and git installed. Make sure that your pip, setuptools, and wheel are up to date. When using pip it is generally recommended to install packages in a virtual environment to avoid changes to the system.

                                      Support

                                      For any new features, suggestions and bugs create an issue on GitHub. If you have any questions check and ask questions on community page Stack Overflow .

                                      DOWNLOAD this Library from

                                      Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from
                                      over 430 million Knowledge Items
                                      Find more libraries
                                      Reuse Solution Kits and Libraries Curated by Popular Use Cases
                                      Explore Kits

                                      Save this library and start creating your kit

                                      Share this Page

                                      share link
                                      Reuse Pre-built Kits with Poker
                                      Consider Popular Machine Learning Libraries
                                      Try Top Libraries by dickreuter
                                      Compare Machine Learning Libraries with Highest Support
                                      Compare Machine Learning Libraries with Highest Quality
                                      Compare Machine Learning Libraries with Highest Security
                                      Compare Machine Learning Libraries with Permissive License
                                      Compare Machine Learning Libraries with Highest Reuse
                                      Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from
                                      over 430 million Knowledge Items
                                      Find more libraries
                                      Reuse Solution Kits and Libraries Curated by Popular Use Cases
                                      Explore Kits

                                      Save this library and start creating your kit

                                      • © 2022 Open Weaver Inc.