forked from AdaGold/Languages
-
Notifications
You must be signed in to change notification settings - Fork 17
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Python/JavaScript Practice #5
Open
noglows
wants to merge
7
commits into
Ada-C4:master
Choose a base branch
from
noglows:master
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 6 commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
3f50014
Poverty data completed in Python
noglows 78719d8
Spaceships example working in Python
noglows 7c3ac68
Folder restructuring
noglows ec57078
Initial commit for Spaceships in Javascript
noglows 2fe9483
Delete poverty-processing.py
noglows a24df68
Delete spaceships-python.py
noglows 704c57c
Code refactoring. Added functions
noglows File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
25 0 760211 743843 776579 11.7 11.4 12.0 209291 200777 217805 15.3 14.7 15.9 143026 135555 150497 14.2 13.5 14.9 69200 68303 70097 61154 57232 65076 17.1 16.0 18.2 Massachusetts MA est14_MA.txt 06NOV2015 | ||
25 1 18801 15272 22330 8.9 7.2 10.6 4498 3495 5501 13.4 10.4 16.4 3151 2418 3884 12.4 9.5 15.3 64150 61187 67113 Barnstable County MA est14_MA.txt 06NOV2015 | ||
25 3 16037 13403 18671 13.0 10.9 15.1 4543 3669 5417 20.4 16.5 24.3 2974 2341 3607 17.8 14.0 21.6 49890 46940 52840 Berkshire County MA est14_MA.txt 06NOV2015 | ||
25 5 66553 60900 72206 12.4 11.4 13.4 20107 17687 22527 17.4 15.3 19.5 13676 11976 15376 15.8 13.8 17.8 57732 55656 59808 Bristol County MA est14_MA.txt 06NOV2015 | ||
25 7 1544 1199 1889 9.0 7.0 11.0 420 321 519 13.4 10.3 16.5 293 223 363 12.6 9.6 15.6 61259 54940 67578 Dukes County MA est14_MA.txt 06NOV2015 | ||
25 9 80526 73169 87883 10.7 9.7 11.7 25774 22528 29020 15.5 13.6 17.4 17893 15538 20248 14.5 12.6 16.4 70074 68522 71626 Essex County MA est14_MA.txt 06NOV2015 | ||
25 11 8397 7117 9677 12.0 10.2 13.8 2091 1677 2505 16.7 13.4 20.0 1418 1101 1735 15.3 11.9 18.7 53953 50412 57494 Franklin County MA est14_MA.txt 06NOV2015 | ||
25 13 80178 73479 86877 17.7 16.2 19.2 27036 24178 29894 26.2 23.4 29.0 18480 16244 20716 24.3 21.4 27.2 49072 47009 51135 Hampden County MA est14_MA.txt 06NOV2015 | ||
25 15 20809 18436 23182 15.0 13.3 16.7 3078 2491 3665 12.5 10.1 14.9 2099 1686 2512 11.1 8.9 13.3 57737 53688 61786 Hampshire County MA est14_MA.txt 06NOV2015 | ||
25 17 134684 126083 143285 8.9 8.3 9.5 30754 27164 34344 9.6 8.5 10.7 20395 17755 23035 8.8 7.7 9.9 84026 81707 86345 Middlesex County MA est14_MA.txt 06NOV2015 | ||
25 19 765 590 940 7.1 5.5 8.7 184 139 229 8.2 6.2 10.2 124 93 155 8.0 6.0 10.0 82596 75718 89474 Nantucket County MA est14_MA.txt 06NOV2015 | ||
25 21 43999 38525 49473 6.5 5.7 7.3 10459 8628 12290 7.0 5.8 8.2 7565 6219 8911 6.8 5.6 8.0 90039 87658 92420 Norfolk County MA est14_MA.txt 06NOV2015 | ||
25 23 42124 36042 48206 8.5 7.3 9.7 13006 10831 15181 11.5 9.6 13.4 8889 7248 10530 10.3 8.4 12.2 74576 72340 76812 Plymouth County MA est14_MA.txt 06NOV2015 | ||
25 25 155184 146128 164240 21.5 20.2 22.8 41079 37354 44804 31.5 28.6 34.4 28556 25858 31254 32.7 29.6 35.8 54280 52553 56007 Suffolk County MA est14_MA.txt 06NOV2015 | ||
25 27 90611 82565 98657 11.5 10.5 12.5 26263 22963 29563 15.0 13.1 16.9 17513 15063 19963 13.4 11.5 15.3 65217 63662 66772 Worcester County MA est14_MA.txt 06NOV2015 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
53 0 913463 895355 931571 13.2 12.9 13.5 275662 265882 285442 17.5 16.9 18.1 180464 171990 188938 16.0 15.2 16.8 61358 60882 61834 85453 80800 90106 19.6 18.5 20.7 Washington WA est14_WA.txt 06NOV2015 | ||
53 1 3598 2947 4249 19.0 15.6 22.4 1816 1477 2155 27.1 22.0 32.2 1152 903 1401 24.7 19.4 30.0 47423 42474 52372 Adams County WA est14_WA.txt 06NOV2015 | ||
53 3 3573 2849 4297 16.3 13.0 19.6 1104 846 1362 24.2 18.5 29.9 723 546 900 21.5 16.2 26.8 44055 39944 48166 Asotin County WA est14_WA.txt 06NOV2015 | ||
53 5 26893 23628 30158 14.6 12.8 16.4 10421 8839 12003 21.3 18.1 24.5 6754 5615 7893 19.0 15.8 22.2 58750 56072 61428 Benton County WA est14_WA.txt 06NOV2015 | ||
53 7 10298 8470 12126 14.0 11.5 16.5 3588 2774 4402 20.2 15.6 24.8 2436 1839 3033 19.2 14.5 23.9 49174 45028 53320 Chelan County WA est14_WA.txt 06NOV2015 | ||
53 9 11518 9848 13188 16.2 13.8 18.6 3267 2671 3863 26.2 21.4 31.0 2025 1593 2457 22.3 17.5 27.1 47185 43543 50827 Clallam County WA est14_WA.txt 06NOV2015 | ||
53 11 44213 38703 49723 9.9 8.7 11.1 15179 12259 18099 13.6 11.0 16.2 10647 8436 12858 12.8 10.2 15.4 61747 60396 63098 Clark County WA est14_WA.txt 06NOV2015 | ||
53 13 607 469 745 15.5 12.0 19.0 190 145 235 25.7 19.6 31.8 130 98 162 22.0 16.6 27.4 45465 41255 49675 Columbia County WA est14_WA.txt 06NOV2015 | ||
53 15 20701 18425 22977 20.6 18.3 22.9 6118 5100 7136 26.8 22.3 31.3 3909 3166 4652 23.1 18.7 27.5 44235 41355 47115 Cowlitz County WA est14_WA.txt 06NOV2015 | ||
53 17 6120 4978 7262 15.5 12.6 18.4 2507 1974 3040 24.4 19.2 29.6 1712 1339 2085 22.7 17.8 27.6 51151 47257 55045 Douglas County WA est14_WA.txt 06NOV2015 | ||
53 19 1700 1392 2008 22.4 18.3 26.5 403 316 490 29.1 22.8 35.4 264 205 323 25.9 20.1 31.7 39992 36038 43946 Ferry County WA est14_WA.txt 06NOV2015 | ||
53 21 14661 12404 16918 17.3 14.6 20.0 7214 6027 8401 24.9 20.8 29.0 4533 3611 5455 22.4 17.8 27.0 55006 51191 58821 Franklin County WA est14_WA.txt 06NOV2015 | ||
53 23 310 240 380 14.2 11.0 17.4 91 70 112 20.7 15.8 25.6 60 45 75 17.4 13.1 21.7 46404 41508 51300 Garfield County WA est14_WA.txt 06NOV2015 | ||
53 25 14508 11796 17220 15.8 12.8 18.8 5766 4441 7091 20.9 16.1 25.7 3918 2983 4853 20.0 15.2 24.8 50388 47611 53165 Grant County WA est14_WA.txt 06NOV2015 | ||
53 27 13322 11257 15387 19.6 16.6 22.6 4146 3376 4916 28.6 23.3 33.9 2760 2199 3321 26.3 21.0 31.6 43205 40965 45445 Grays Harbor County WA est14_WA.txt 06NOV2015 | ||
53 29 7964 6639 9289 10.3 8.6 12.0 2267 1801 2733 15.4 12.2 18.6 1514 1190 1838 14.7 11.6 17.8 59358 55827 62889 Island County WA est14_WA.txt 06NOV2015 | ||
53 31 4183 3445 4921 14.1 11.6 16.6 972 770 1174 24.5 19.4 29.6 643 502 784 21.8 17.0 26.6 50964 46641 55287 Jefferson County WA est14_WA.txt 06NOV2015 | ||
53 33 230750 218081 243419 11.3 10.7 11.9 58351 52757 63945 13.6 12.3 14.9 38527 34470 42584 12.8 11.5 14.1 75738 74417 77059 King County WA est14_WA.txt 06NOV2015 | ||
53 35 27550 23819 31281 11.2 9.7 12.7 7473 6103 8843 14.4 11.8 17.0 4593 3607 5579 12.2 9.6 14.8 61898 59584 64212 Kitsap County WA est14_WA.txt 06NOV2015 | ||
53 37 7459 6329 8589 18.6 15.8 21.4 1410 1105 1715 18.7 14.7 22.7 953 742 1164 17.6 13.7 21.5 48127 44926 51328 Kittitas County WA est14_WA.txt 06NOV2015 | ||
53 39 3029 2365 3693 14.6 11.4 17.8 935 713 1157 22.6 17.2 28.0 641 481 801 20.9 15.7 26.1 49348 44723 53973 Klickitat County WA est14_WA.txt 06NOV2015 | ||
53 41 12695 10463 14927 17.1 14.1 20.1 3912 3075 4749 24.5 19.3 29.7 2600 2017 3183 22.3 17.3 27.3 44243 40710 47776 Lewis County WA est14_WA.txt 06NOV2015 | ||
53 43 1274 1002 1546 12.5 9.8 15.2 392 303 481 17.7 13.7 21.7 269 207 331 15.7 12.1 19.3 49955 45180 54730 Lincoln County WA est14_WA.txt 06NOV2015 | ||
53 45 9040 7636 10444 15.6 13.2 18.0 2660 2093 3227 23.6 18.6 28.6 1805 1406 2204 22.4 17.4 27.4 52313 49305 55321 Mason County WA est14_WA.txt 06NOV2015 | ||
53 47 9427 8024 10830 23.2 19.8 26.6 2969 2411 3527 31.5 25.6 37.4 1992 1578 2406 29.5 23.4 35.6 37782 34745 40819 Okanogan County WA est14_WA.txt 06NOV2015 | ||
53 49 3606 2929 4283 17.8 14.5 21.1 965 775 1155 28.8 23.1 34.5 674 538 810 28.0 22.4 33.6 40189 36441 43937 Pacific County WA est14_WA.txt 06NOV2015 | ||
53 51 2868 2398 3338 22.3 18.6 26.0 842 665 1019 33.1 26.2 40.0 588 463 713 30.2 23.8 36.6 42579 38373 46785 Pend Oreille County WA est14_WA.txt 06NOV2015 | ||
53 53 106432 97890 114974 13.1 12.1 14.1 34165 30111 38219 17.5 15.4 19.6 22439 19462 25416 16.2 14.1 18.3 60397 58946 61848 Pierce County WA est14_WA.txt 06NOV2015 | ||
53 55 2018 1729 2307 12.7 10.9 14.5 437 351 523 19.6 15.7 23.5 290 227 353 16.7 13.1 20.3 54721 50513 58929 San Juan County WA est14_WA.txt 06NOV2015 | ||
53 57 18627 16409 20845 15.7 13.8 17.6 6124 5231 7017 23.2 19.8 26.6 3765 3106 4424 19.8 16.3 23.3 51395 48709 54081 Skagit County WA est14_WA.txt 06NOV2015 | ||
53 59 1421 1099 1743 12.6 9.7 15.5 467 353 581 20.1 15.2 25.0 316 235 397 17.5 13.0 22.0 52673 47473 57873 Skamania County WA est14_WA.txt 06NOV2015 | ||
53 61 73930 66931 80929 9.9 9.0 10.8 22598 19490 25706 13.1 11.3 14.9 14401 12105 16697 11.5 9.7 13.3 71890 70201 73579 Snohomish County WA est14_WA.txt 06NOV2015 | ||
53 63 76910 70461 83359 16.3 14.9 17.7 21892 18858 24926 20.5 17.7 23.3 13976 11760 16192 18.2 15.3 21.1 50083 48190 51976 Spokane County WA est14_WA.txt 06NOV2015 | ||
53 65 8368 7255 9481 19.3 16.7 21.9 2668 2169 3167 28.2 22.9 33.5 1773 1413 2133 24.5 19.5 29.5 43823 40849 46797 Stevens County WA est14_WA.txt 06NOV2015 | ||
53 67 31197 27796 34598 11.9 10.6 13.2 9031 7502 10560 15.6 13.0 18.2 5706 4551 6861 13.7 10.9 16.5 61653 59047 64259 Thurston County WA est14_WA.txt 06NOV2015 | ||
53 69 558 431 685 13.9 10.7 17.1 184 141 227 26.7 20.4 33.0 130 98 162 24.3 18.3 30.3 51022 48377 53667 Wahkiakum County WA est14_WA.txt 06NOV2015 | ||
53 71 8682 7030 10334 15.7 12.7 18.7 2654 2046 3262 20.8 16.0 25.6 1762 1341 2183 19.1 14.6 23.6 49819 46459 53179 Walla Walla County WA est14_WA.txt 06NOV2015 | ||
53 73 31842 28461 35223 15.7 14.0 17.4 7304 6146 8462 17.7 14.9 20.5 4888 4054 5722 16.4 13.6 19.2 53733 51153 56313 Whatcom County WA est14_WA.txt 06NOV2015 | ||
53 75 11567 10634 12500 28.4 26.1 30.7 1181 938 1424 16.7 13.3 20.1 704 529 879 14.6 11.0 18.2 41837 37907 45767 Whitman County WA est14_WA.txt 06NOV2015 | ||
53 77 50044 45009 55079 20.5 18.4 22.6 22000 19457 24543 30.3 26.8 33.8 14492 12596 16388 28.0 24.3 31.7 44342 42101 46583 Yakima County WA est14_WA.txt 06NOV2015 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
<!DOCTYPE HTML> | ||
<html lang = "en"> | ||
<head> | ||
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.4/jquery.min.js"></script> | ||
<script src="spaceships-javascript.js"></script> | ||
<title>Spaceships</title> | ||
<meta charset = "UTF-8" /> | ||
</head> | ||
<body> | ||
<h1>Planet Express</h1> | ||
<table> | ||
<tr> | ||
<th>Property</th> | ||
<th>Current Level</th> | ||
</tr> | ||
<tr> | ||
<td>Fry's Thirst Level</td> | ||
<td id="thirst"></td> | ||
</tr> | ||
<tr> | ||
<td>Leela's Unfulfilled Work Orders</td> | ||
<td id="work"></td> | ||
</tr> | ||
<tr> | ||
<td>Bender's Horde of Treasure</td> | ||
<td id="horde"></td> | ||
</tr> | ||
<tr> | ||
<td>Zoidberg’s Hunger Level</td> | ||
<td id="hunger"></td> | ||
</tr> | ||
<tr> | ||
<td>Hermes’s Backlog of Receipts to Process</td> | ||
<td id="receipts"></td> | ||
</tr> | ||
</table> | ||
|
||
<button id="drink">Drink</button> | ||
<button id="deliver">Deliver</button> | ||
<button id="steal">Steal</button> | ||
<button id="eat">Eat</button> | ||
<button id="account">Account</button> | ||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,73 @@ | ||
function PlanetExpress (max, start) { | ||
this.stable = true; | ||
this.thirst = start; | ||
this.work = start; | ||
this.horde = start; | ||
this.hunger = start; | ||
this.receipts = start; | ||
this.max = max; | ||
} | ||
|
||
PlanetExpress.prototype.drink = function(){ | ||
this.thirst--; | ||
this.work++; | ||
}; | ||
|
||
PlanetExpress.prototype.deliver = function(){ | ||
this.work--; | ||
this.receipts++; | ||
}; | ||
|
||
PlanetExpress.prototype.steal = function(){ | ||
this.horde++; | ||
this.work++; | ||
}; | ||
|
||
PlanetExpress.prototype.eat = function(){ | ||
this.hunger--; | ||
this.work++; | ||
}; | ||
|
||
PlanetExpress.prototype.account = function(){ | ||
this.receipts--; | ||
this.horde--; | ||
}; | ||
|
||
PlanetExpress.prototype.updateLevels = function(){ | ||
$("#thirst").text(planet.thirst); | ||
$("#work").text(planet.work); | ||
$("#horde").text(planet.horde); | ||
$("#hunger").text(planet.hunger); | ||
$("#receipts").text(planet.receipts); | ||
}; | ||
|
||
var planet = new PlanetExpress(10, 5); | ||
|
||
$(document).ready(function(){ | ||
planet.updateLevels(); | ||
|
||
$("#drink").click(function(){ | ||
planet.drink(); | ||
planet.updateLevels(); | ||
}); | ||
|
||
$("#deliver").click(function(){ | ||
planet.deliver(); | ||
planet.updateLevels(); | ||
}); | ||
|
||
$("#steal").click(function(){ | ||
planet.steal(); | ||
planet.updateLevels(); | ||
}); | ||
|
||
$("#eat").click(function(){ | ||
planet.eat(); | ||
planet.updateLevels(); | ||
}); | ||
|
||
$("#account").click(function(){ | ||
planet.account(); | ||
planet.updateLevels(); | ||
}); | ||
}); |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice! I like the way you've done this with JS :-)