{"action":"closed","issue":{"url":"https://api.github.com/repos/tiagomestreteixeira/MITx-6.00.1x-Introduction-to-Computer-Science-and-Programming-Using-Python/issues/32","repository_url":"https://api.github.com/repos/tiagomestreteixeira/MITx-6.00.1x-Introduction-to-Computer-Science-and-Programming-Using-Python","labels_url":"https://api.github.com/repos/tiagomestreteixeira/MITx-6.00.1x-Introduction-to-Computer-Science-and-Programming-Using-Python/issues/32/labels{/name}","comments_url":"https://api.github.com/repos/tiagomestreteixeira/MITx-6.00.1x-Introduction-to-Computer-Science-and-Programming-Using-Python/issues/32/comments","events_url":"https://api.github.com/repos/tiagomestreteixeira/MITx-6.00.1x-Introduction-to-Computer-Science-and-Programming-Using-Python/issues/32/events","html_url":"https://github.com/tiagomestreteixeira/MITx-6.00.1x-Introduction-to-Computer-Science-and-Programming-Using-Python/issues/32","id":180953013,"number":32,"title":"Problem Set 4 - Problem 1","user":{"login":"tiagomestreteixeira","id":4828597,"avatar_url":"https://avatars.githubusercontent.com/u/4828597?v=3","gravatar_id":"","url":"https://api.github.com/users/tiagomestreteixeira","html_url":"https://github.com/tiagomestreteixeira","followers_url":"https://api.github.com/users/tiagomestreteixeira/followers","following_url":"https://api.github.com/users/tiagomestreteixeira/following{/other_user}","gists_url":"https://api.github.com/users/tiagomestreteixeira/gists{/gist_id}","starred_url":"https://api.github.com/users/tiagomestreteixeira/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tiagomestreteixeira/subscriptions","organizations_url":"https://api.github.com/users/tiagomestreteixeira/orgs","repos_url":"https://api.github.com/users/tiagomestreteixeira/repos","events_url":"https://api.github.com/users/tiagomestreteixeira/events{/privacy}","received_events_url":"https://api.github.com/users/tiagomestreteixeira/received_events","type":"User","site_admin":false},"labels":[{"id":464324024,"url":"https://api.github.com/repos/tiagomestreteixeira/MITx-6.00.1x-Introduction-to-Computer-Science-and-Programming-Using-Python/labels/in%20progress","name":"in progress","color":"FA1515","default":false},{"id":448857298,"url":"https://api.github.com/repos/tiagomestreteixeira/MITx-6.00.1x-Introduction-to-Computer-Science-and-Programming-Using-Python/labels/Problem%20Set","name":"Problem Set","color":"00bb00","default":false}],"state":"closed","locked":false,"assignee":{"login":"tiagomestreteixeira","id":4828597,"avatar_url":"https://avatars.githubusercontent.com/u/4828597?v=3","gravatar_id":"","url":"https://api.github.com/users/tiagomestreteixeira","html_url":"https://github.com/tiagomestreteixeira","followers_url":"https://api.github.com/users/tiagomestreteixeira/followers","following_url":"https://api.github.com/users/tiagomestreteixeira/following{/other_user}","gists_url":"https://api.github.com/users/tiagomestreteixeira/gists{/gist_id}","starred_url":"https://api.github.com/users/tiagomestreteixeira/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tiagomestreteixeira/subscriptions","organizations_url":"https://api.github.com/users/tiagomestreteixeira/orgs","repos_url":"https://api.github.com/users/tiagomestreteixeira/repos","events_url":"https://api.github.com/users/tiagomestreteixeira/events{/privacy}","received_events_url":"https://api.github.com/users/tiagomestreteixeira/received_events","type":"User","site_admin":false},"assignees":[{"login":"tiagomestreteixeira","id":4828597,"avatar_url":"https://avatars.githubusercontent.com/u/4828597?v=3","gravatar_id":"","url":"https://api.github.com/users/tiagomestreteixeira","html_url":"https://github.com/tiagomestreteixeira","followers_url":"https://api.github.com/users/tiagomestreteixeira/followers","following_url":"https://api.github.com/users/tiagomestreteixeira/following{/other_user}","gists_url":"https://api.github.com/users/tiagomestreteixeira/gists{/gist_id}","starred_url":"https://api.github.com/users/tiagomestreteixeira/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tiagomestreteixeira/subscriptions","organizations_url":"https://api.github.com/users/tiagomestreteixeira/orgs","repos_url":"https://api.github.com/users/tiagomestreteixeira/repos","events_url":"https://api.github.com/users/tiagomestreteixeira/events{/privacy}","received_events_url":"https://api.github.com/users/tiagomestreteixeira/received_events","type":"User","site_admin":false}],"milestone":{"url":"https://api.github.com/repos/tiagomestreteixeira/MITx-6.00.1x-Introduction-to-Computer-Science-and-Programming-Using-Python/milestones/5","html_url":"https://github.com/tiagomestreteixeira/MITx-6.00.1x-Introduction-to-Computer-Science-and-Programming-Using-Python/milestones/Week%204","labels_url":"https://api.github.com/repos/tiagomestreteixeira/MITx-6.00.1x-Introduction-to-Computer-Science-and-Programming-Using-Python/milestones/5/labels","id":2047511,"number":5,"title":"Week 4","description":"","creator":{"login":"tiagomestreteixeira","id":4828597,"avatar_url":"https://avatars.githubusercontent.com/u/4828597?v=3","gravatar_id":"","url":"https://api.github.com/users/tiagomestreteixeira","html_url":"https://github.com/tiagomestreteixeira","followers_url":"https://api.github.com/users/tiagomestreteixeira/followers","following_url":"https://api.github.com/users/tiagomestreteixeira/following{/other_user}","gists_url":"https://api.github.com/users/tiagomestreteixeira/gists{/gist_id}","starred_url":"https://api.github.com/users/tiagomestreteixeira/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tiagomestreteixeira/subscriptions","organizations_url":"https://api.github.com/users/tiagomestreteixeira/orgs","repos_url":"https://api.github.com/users/tiagomestreteixeira/repos","events_url":"https://api.github.com/users/tiagomestreteixeira/events{/privacy}","received_events_url":"https://api.github.com/users/tiagomestreteixeira/received_events","type":"User","site_admin":false},"open_issues":4,"closed_issues":4,"state":"open","created_at":"2016-10-04T17:19:32Z","updated_at":"2016-10-30T16:15:21Z","due_on":"2016-10-18T00:00:00Z","closed_at":null},"comments":0,"created_at":"2016-10-04T17:18:43Z","updated_at":"2016-10-30T16:15:20Z","closed_at":"2016-10-30T16:15:20Z","body":"### Problem 1 - Word Scores\r\n\r\nThe first step is to implement some code that allows us to calculate the score for a single word. The function `getWordScore` should accept as input a string of lowercase letters (a word) and return the integer score for that word, using the game's scoring rules.\r\n\r\nA Reminder of the Scoring Rules:\r\n\r\n**Scoring**\r\n- The score for the hand is the sum of the scores for each word formed.\r\n- The score for a word is the sum of the points for letters in the word, multiplied by the length of the word, plus 50 points if all n letters are used on the first word created.\r\n- Letters are scored as in Scrabble; A is worth 1, B is worth 3, C is worth 3, D is worth 2, E is worth 1, and so on. We have defined the dictionary SCRABBLE_LETTER_VALUES that maps each lowercase letter to its Scrabble letter value.\r\n- For example, 'weed' would be worth 32 points ((4+1+1+2) for the four letters, then multiply by `len('weed')` to get (4+1+1+2)*4 = 32). Be sure to check that the hand actually has 1 'w', 2 'e's, and 1 'd' before scoring the word!\r\n- As another example, if n=7 and you make the word 'waybill' on the first try, it would be worth 155 points (the base score for 'waybill' is (4+1+4+3+1+1+1)*7=105, plus an additional 50 point bonus for using all n letters).\r\n\r\n### _HINTS_\r\n\r\n- You may assume that the input `word` is always either a string of lowercase letters, or the empty string `\"\"`.\r\n- You will want to use the `SCRABBLE_LETTER_VALUES` dictionary defined at the top of `ps4a.py`. You should not change its value.\r\n- Do **not** assume that there are always 7 letters in a hand! The parameter n is the number of letters required for a bonus score (the maximum number of letters in the hand). Our goal is to keep the code modular - if you want to try playing your word game with n=10 or n=4, you will be able to do it by simply changing the value of HAND_SIZE!\r\n- **Testing**: If this function is implemented properly, and you run `test_ps4a.py`, you should see that the `test_getWordScore()` tests pass. Also test your implementation of getWordScore, using some reasonable English words.\r\nFill in the code for getWordScore in ps4a.py and be sure you've passed the appropriate tests in test_ps4a.py before pasting your function definition here.\r\n\r\n---------------\r\nTask of #31"}}
{"actor":{"display_login":"tiagomestreteixeira"}}