gevers3 / assignments Goto Github PK
View Code? Open in Web Editor NEWHomework for Suncoast
Homework for Suncoast
In this project you will create a playable game of Blackjack.
Create a single player black jack games that plays against the house, i.e. a human player and computer dealer. You are free to create the user interface however you want, but keep it simple for Explorer Mode.
General Rules:
images
folder in your projectcards.zip
file and then copy/move the extracted images into your project's images
folderPlayers win by not busting and having a total higher than the dealer, or not busting and having the dealer bust, or getting a blackjack without the dealer getting a blackjack. If the player and dealer have the same total (not counting blackjacks), this is called a "push", and the player typically does not win or lose money on that hand. Otherwise, the dealer wins.
In this project, you will use JavaScript to model a deck of playing cards. You'll also add functionality to it such as shuffling and dealing.
Computers are notoriously bad at random numbers. This is a pretty deep and complex topic, but it's worth pointing out that most random numbers we use in computing are actually "pseudorandom". For this assignment, you will read about, then implement, a popular algorithm that shuffles the order of a finite set using JavaScript's built in Math.random()
function as a pseudorandom number generator.
You will model these in code, in any way you see fit. It may require you to experiment and try a number of techniques. There are many valid solutions. Your user interface should consist of a face down deck, and a face up "hand" of cards that have been dealt.
Read about, and implement the Fisher–Yates shuffle algorithm:
For our purposes, n
is 52
:
for i from n - 1 down to 1 do:
j = random integer (where 0 <= j <= i)
swap items[i] with items[j]
This snippet will give you a random integer, z
between 0
and n
:
const z = Math.floor(Math.random() * n)
Let's break this down from the inside out:
n
is 20
.Math.random()
to generate a floating-point number between 0
and 1
. Let's assume our random value is 0.42
.n
. If we think of this random value as a percentage, multiplying these gives us a number that is some "percentage" of n
. Their product is 8.4
, or 42% of n
.Math.floor()
to round down to the nearest whole number, i.e. 8
.Because we're rounding down, it's impossible to get 20
. This will give us an integer between 0
and 19
. This technique is perfect for finding a "random" index in an array of length n
.
GitHub has a great mascot called OctoCat. OctoCat even has its own gallery of variations, created by GitHub itself and fans, called Octodex.
Unfortunately, the Octodex is not responsive*! Today, your task is to recreate the layout of The Octodex as closely as possible, but make it responsive. You can use all the tools you have at your disposal to get the job done. Use your browser's Developer Tools to inspect their site to find the exact font sizes and padding amounts.
* Well, actually it uses javascript to set the number of columns on page load, but we want to see interactive responsiveness when we resize our window!
You should strive to implement the design as close as possible, though, especially if you've never touch HTML or CSS before, this can be extraordinarily difficult and will take a lot of practice and mileage.
Note: You should complete at least the tasks given for explorer mode as listed below before turning in the assignment, as well as before attempting adventure or epic modes.
flex-wrap
property).TIP Reminder to breakdown the layout into smaller chunks that are easier to style
In this assignment, you'll build a front end for an API of your choice
We're going to build a front end for an API of your choice. Choose one from this list
NOTE You'll need to choose one with Auth
being No
since we haven't covered apiKeys
or OAuth
authentication yet. We will go over this on Thursday
NOTE You'll also need to check to see if the API will work from your browser. You can do a quick check by making a small app-app
, doing a cURL request.
For this assignment, you will be creating a simple interactive scoreboard for your favorite sport.
update
buttons to update the corresponding values on the page. The score buttons should adjust the current score by a "hard-coded" value.In this assignment, you will end up with a simple styled web page, published on the web.
Create a new website that shows some basic styling and formatting using HTML and CSS. This website should help share some information for one of your favorite hobbies.
git
, hub
, and node
installed. We should have done this together in class.app-app
project.In your first assignment, you will end up with a web page, no matter how simple, published on the web.
You will create a simple website that will showcase one of your passions. This is not about making the website flashy, but more about focusing on creating a website and learning your new tools.
Have git
, hub
, node
, app-app
installed. We should have done this together in class. Reminder: you only have to install these tools once.
All of your HTML (and CSS if you do epic mode) should be formatted cleanly and consistently (use your editor to your advantage).
If you have experience with existing HTML/CSS frameworks (bootstrap, bulma, etc) you may not use them for these assignments.
HTML Tag Reference
below). Give your webpage a simple header and footer as well.a
to add (at least 2) more pages to your site.id
and class
HTML attributes.A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.