{"action":"created","comment":{"url":"https://api.github.com/repos/bbcmicrobit/micropython/pulls/comments/66701854","id":66701854,"diff_hunk":"@@ -0,0 +1,66 @@\n+\"\"\"\n+    emoji_pet.py\n+    ~~~~~~~~\n+\n+    A reactive \"pet\" which changes face depending on certain inputs\n+    editable by the user. Emotions are functions of an animation function.\n+    You can optionally get reactive sounds from by\n+    connecting a speaker/buzzer/headphone to P0 and GND.\n+\"\"\"\n+from microbit import *\n+import music\n+\n+# Various emoji states of the face\n+neutral_face = Image(\"09090:00000:99999:00000:00000\")\n+neutral_face2 = Image(\"09090:00000:00000:99999:00000\")\n+\n+squiggle_face1 = Image(\"09090:00000:90000:99999:00009\")\n+squiggle_face2 = Image(\"09090:00000:00009:99999:90000\")\n+\n+grin_face = Image(\"09090:00000:90009:09990:00000\")\n+happy_face = Image(\"09090:00000:99999:90009:09990\")\n+\n+frowning_face = Image(\"09090:00000:09990:90009:00000\")\n+sad_face = Image(\"09090:00000:09990:90009:90009\")\n+\n+small_tongue = Image(\"07090:00000:99999:00990:00000\")\n+\n+\n+def get_happy(loops=2, delay=500):\n+    # A series of happy faces\n+    music.play(music.BA_DING, wait=False)\n+    display.show([neutral_face, grin_face, happy_face], delay=delay)\n+\n+\n+def get_sad(loops=2, delay=500):\n+    # A series of sad faces\n+    music.play(music.POWER_DOWN, wait=False)\n+    display.show([neutral_face, frowning_face, sad_face], delay=delay)\n+\n+\n+def get_neutral(loops=2, delay=500):\n+    # A series of grim / neutral faces\n+    display.show([\n+        neutral_face2,\n+        squiggle_face1,\n+        squiggle_face2,\n+        neutral_face\n+    ], delay=delay)\n+\n+\n+def get_silly(loops=2, delay=500):","path":"examples/emoji_pet.py","position":51,"original_position":51,"commit_id":"53d6229f60fa39b88b5269e8d9326a7a575f61de","original_commit_id":"53d6229f60fa39b88b5269e8d9326a7a575f61de","user":{"login":"ntoll","id":37602,"avatar_url":"https://avatars.githubusercontent.com/u/37602?v=3","gravatar_id":"","url":"https://api.github.com/users/ntoll","html_url":"https://github.com/ntoll","followers_url":"https://api.github.com/users/ntoll/followers","following_url":"https://api.github.com/users/ntoll/following{/other_user}","gists_url":"https://api.github.com/users/ntoll/gists{/gist_id}","starred_url":"https://api.github.com/users/ntoll/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ntoll/subscriptions","organizations_url":"https://api.github.com/users/ntoll/orgs","repos_url":"https://api.github.com/users/ntoll/repos","events_url":"https://api.github.com/users/ntoll/events{/privacy}","received_events_url":"https://api.github.com/users/ntoll/received_events","type":"User","site_admin":false},"body":"You guessed it, loops...!?!?! ;-)","created_at":"2016-06-11T06:27:49Z","updated_at":"2016-06-11T06:27:49Z","html_url":"https://github.com/bbcmicrobit/micropython/pull/302#discussion_r66701854","pull_request_url":"https://api.github.com/repos/bbcmicrobit/micropython/pulls/302","_links":{"self":{"href":"https://api.github.com/repos/bbcmicrobit/micropython/pulls/comments/66701854"},"html":{"href":"https://github.com/bbcmicrobit/micropython/pull/302#discussion_r66701854"},"pull_request":{"href":"https://api.github.com/repos/bbcmicrobit/micropython/pulls/302"}}},"pull_request":{"url":"https://api.github.com/repos/bbcmicrobit/micropython/pulls/302","id":72613552,"html_url":"https://github.com/bbcmicrobit/micropython/pull/302","diff_url":"https://github.com/bbcmicrobit/micropython/pull/302.diff","patch_url":"https://github.com/bbcmicrobit/micropython/pull/302.patch","issue_url":"https://api.github.com/repos/bbcmicrobit/micropython/issues/302","number":302,"state":"open","locked":false,"title":"added function examples via emoji_pet","user":{"login":"octaflop","id":6115,"avatar_url":"https://avatars.githubusercontent.com/u/6115?v=3","gravatar_id":"","url":"https://api.github.com/users/octaflop","html_url":"https://github.com/octaflop","followers_url":"https://api.github.com/users/octaflop/followers","following_url":"https://api.github.com/users/octaflop/following{/other_user}","gists_url":"https://api.github.com/users/octaflop/gists{/gist_id}","starred_url":"https://api.github.com/users/octaflop/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/octaflop/subscriptions","organizations_url":"https://api.github.com/users/octaflop/orgs","repos_url":"https://api.github.com/users/octaflop/repos","events_url":"https://api.github.com/users/octaflop/events{/privacy}","received_events_url":"https://api.github.com/users/octaflop/received_events","type":"User","site_admin":false},"body":"some more rudimentary :smile: :cry: examples and examples of using inputs and functions to run small-to-medium-sized programs.","created_at":"2016-06-04T21:26:28Z","updated_at":"2016-06-11T06:27:49Z","closed_at":null,"merged_at":null,"merge_commit_sha":"d6b1a5835268af238e2769bc88774e69755fe79f","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/bbcmicrobit/micropython/pulls/302/commits","review_comments_url":"https://api.github.com/repos/bbcmicrobit/micropython/pulls/302/comments","review_comment_url":"https://api.github.com/repos/bbcmicrobit/micropython/pulls/comments{/number}","comments_url":"https://api.github.com/repos/bbcmicrobit/micropython/issues/302/comments","statuses_url":"https://api.github.com/repos/bbcmicrobit/micropython/statuses/53d6229f60fa39b88b5269e8d9326a7a575f61de","head":{"label":"octaflop:function_examples","ref":"function_examples","sha":"53d6229f60fa39b88b5269e8d9326a7a575f61de","user":{"login":"octaflop","id":6115,"avatar_url":"https://avatars.githubusercontent.com/u/6115?v=3","gravatar_id":"","url":"https://api.github.com/users/octaflop","html_url":"https://github.com/octaflop","followers_url":"https://api.github.com/users/octaflop/followers","following_url":"https://api.github.com/users/octaflop/following{/other_user}","gists_url":"https://api.github.com/users/octaflop/gists{/gist_id}","starred_url":"https://api.github.com/users/octaflop/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/octaflop/subscriptions","organizations_url":"https://api.github.com/users/octaflop/orgs","repos_url":"https://api.github.com/users/octaflop/repos","events_url":"https://api.github.com/users/octaflop/events{/privacy}","received_events_url":"https://api.github.com/users/octaflop/received_events","type":"User","site_admin":false},"repo":{"id":60379265,"name":"micropython","full_name":"octaflop/micropython","owner":{"login":"octaflop","id":6115,"avatar_url":"https://avatars.githubusercontent.com/u/6115?v=3","gravatar_id":"","url":"https://api.github.com/users/octaflop","html_url":"https://github.com/octaflop","followers_url":"https://api.github.com/users/octaflop/followers","following_url":"https://api.github.com/users/octaflop/following{/other_user}","gists_url":"https://api.github.com/users/octaflop/gists{/gist_id}","starred_url":"https://api.github.com/users/octaflop/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/octaflop/subscriptions","organizations_url":"https://api.github.com/users/octaflop/orgs","repos_url":"https://api.github.com/users/octaflop/repos","events_url":"https://api.github.com/users/octaflop/events{/privacy}","received_events_url":"https://api.github.com/users/octaflop/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/octaflop/micropython","description":"Port of MicroPython for the BBC micro:bit","fork":true,"url":"https://api.github.com/repos/octaflop/micropython","forks_url":"https://api.github.com/repos/octaflop/micropython/forks","keys_url":"https://api.github.com/repos/octaflop/micropython/keys{/key_id}","collaborators_url":"https://api.github.com/repos/octaflop/micropython/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/octaflop/micropython/teams","hooks_url":"https://api.github.com/repos/octaflop/micropython/hooks","issue_events_url":"https://api.github.com/repos/octaflop/micropython/issues/events{/number}","events_url":"https://api.github.com/repos/octaflop/micropython/events","assignees_url":"https://api.github.com/repos/octaflop/micropython/assignees{/user}","branches_url":"https://api.github.com/repos/octaflop/micropython/branches{/branch}","tags_url":"https://api.github.com/repos/octaflop/micropython/tags","blobs_url":"https://api.github.com/repos/octaflop/micropython/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/octaflop/micropython/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/octaflop/micropython/git/refs{/sha}","trees_url":"https://api.github.com/repos/octaflop/micropython/git/trees{/sha}","statuses_url":"https://api.github.com/repos/octaflop/micropython/statuses/{sha}","languages_url":"https://api.github.com/repos/octaflop/micropython/languages","stargazers_url":"https://api.github.com/repos/octaflop/micropython/stargazers","contributors_url":"https://api.github.com/repos/octaflop/micropython/contributors","subscribers_url":"https://api.github.com/repos/octaflop/micropython/subscribers","subscription_url":"https://api.github.com/repos/octaflop/micropython/subscription","commits_url":"https://api.github.com/repos/octaflop/micropython/commits{/sha}","git_commits_url":"https://api.github.com/repos/octaflop/micropython/git/commits{/sha}","comments_url":"https://api.github.com/repos/octaflop/micropython/comments{/number}","issue_comment_url":"https://api.github.com/repos/octaflop/micropython/issues/comments{/number}","contents_url":"https://api.github.com/repos/octaflop/micropython/contents/{+path}","compare_url":"https://api.github.com/repos/octaflop/micropython/compare/{base}...{head}","merges_url":"https://api.github.com/repos/octaflop/micropython/merges","archive_url":"https://api.github.com/repos/octaflop/micropython/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/octaflop/micropython/downloads","issues_url":"https://api.github.com/repos/octaflop/micropython/issues{/number}","pulls_url":"https://api.github.com/repos/octaflop/micropython/pulls{/number}","milestones_url":"https://api.github.com/repos/octaflop/micropython/milestones{/number}","notifications_url":"https://api.github.com/repos/octaflop/micropython/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/octaflop/micropython/labels{/name}","releases_url":"https://api.github.com/repos/octaflop/micropython/releases{/id}","deployments_url":"https://api.github.com/repos/octaflop/micropython/deployments","created_at":"2016-06-03T21:39:57Z","updated_at":"2016-06-03T21:39:59Z","pushed_at":"2016-06-04T22:06:56Z","git_url":"git://github.com/octaflop/micropython.git","ssh_url":"git@github.com:octaflop/micropython.git","clone_url":"https://github.com/octaflop/micropython.git","svn_url":"https://github.com/octaflop/micropython","homepage":"","size":13129,"stargazers_count":0,"watchers_count":0,"language":"C","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"bbcmicrobit:master","ref":"master","sha":"d533010d75d868b76d1d1ffcdaa45c4753de2847","user":{"login":"bbcmicrobit","id":15104236,"avatar_url":"https://avatars.githubusercontent.com/u/15104236?v=3","gravatar_id":"","url":"https://api.github.com/users/bbcmicrobit","html_url":"https://github.com/bbcmicrobit","followers_url":"https://api.github.com/users/bbcmicrobit/followers","following_url":"https://api.github.com/users/bbcmicrobit/following{/other_user}","gists_url":"https://api.github.com/users/bbcmicrobit/gists{/gist_id}","starred_url":"https://api.github.com/users/bbcmicrobit/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bbcmicrobit/subscriptions","organizations_url":"https://api.github.com/users/bbcmicrobit/orgs","repos_url":"https://api.github.com/users/bbcmicrobit/repos","events_url":"https://api.github.com/users/bbcmicrobit/events{/privacy}","received_events_url":"https://api.github.com/users/bbcmicrobit/received_events","type":"Organization","site_admin":false},"repo":{"id":40358251,"name":"micropython","full_name":"bbcmicrobit/micropython","owner":{"login":"bbcmicrobit","id":15104236,"avatar_url":"https://avatars.githubusercontent.com/u/15104236?v=3","gravatar_id":"","url":"https://api.github.com/users/bbcmicrobit","html_url":"https://github.com/bbcmicrobit","followers_url":"https://api.github.com/users/bbcmicrobit/followers","following_url":"https://api.github.com/users/bbcmicrobit/following{/other_user}","gists_url":"https://api.github.com/users/bbcmicrobit/gists{/gist_id}","starred_url":"https://api.github.com/users/bbcmicrobit/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bbcmicrobit/subscriptions","organizations_url":"https://api.github.com/users/bbcmicrobit/orgs","repos_url":"https://api.github.com/users/bbcmicrobit/repos","events_url":"https://api.github.com/users/bbcmicrobit/events{/privacy}","received_events_url":"https://api.github.com/users/bbcmicrobit/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/bbcmicrobit/micropython","description":"Port of MicroPython for the BBC micro:bit","fork":false,"url":"https://api.github.com/repos/bbcmicrobit/micropython","forks_url":"https://api.github.com/repos/bbcmicrobit/micropython/forks","keys_url":"https://api.github.com/repos/bbcmicrobit/micropython/keys{/key_id}","collaborators_url":"https://api.github.com/repos/bbcmicrobit/micropython/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/bbcmicrobit/micropython/teams","hooks_url":"https://api.github.com/repos/bbcmicrobit/micropython/hooks","issue_events_url":"https://api.github.com/repos/bbcmicrobit/micropython/issues/events{/number}","events_url":"https://api.github.com/repos/bbcmicrobit/micropython/events","assignees_url":"https://api.github.com/repos/bbcmicrobit/micropython/assignees{/user}","branches_url":"https://api.github.com/repos/bbcmicrobit/micropython/branches{/branch}","tags_url":"https://api.github.com/repos/bbcmicrobit/micropython/tags","blobs_url":"https://api.github.com/repos/bbcmicrobit/micropython/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/bbcmicrobit/micropython/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/bbcmicrobit/micropython/git/refs{/sha}","trees_url":"https://api.github.com/repos/bbcmicrobit/micropython/git/trees{/sha}","statuses_url":"https://api.github.com/repos/bbcmicrobit/micropython/statuses/{sha}","languages_url":"https://api.github.com/repos/bbcmicrobit/micropython/languages","stargazers_url":"https://api.github.com/repos/bbcmicrobit/micropython/stargazers","contributors_url":"https://api.github.com/repos/bbcmicrobit/micropython/contributors","subscribers_url":"https://api.github.com/repos/bbcmicrobit/micropython/subscribers","subscription_url":"https://api.github.com/repos/bbcmicrobit/micropython/subscription","commits_url":"https://api.github.com/repos/bbcmicrobit/micropython/commits{/sha}","git_commits_url":"https://api.github.com/repos/bbcmicrobit/micropython/git/commits{/sha}","comments_url":"https://api.github.com/repos/bbcmicrobit/micropython/comments{/number}","issue_comment_url":"https://api.github.com/repos/bbcmicrobit/micropython/issues/comments{/number}","contents_url":"https://api.github.com/repos/bbcmicrobit/micropython/contents/{+path}","compare_url":"https://api.github.com/repos/bbcmicrobit/micropython/compare/{base}...{head}","merges_url":"https://api.github.com/repos/bbcmicrobit/micropython/merges","archive_url":"https://api.github.com/repos/bbcmicrobit/micropython/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/bbcmicrobit/micropython/downloads","issues_url":"https://api.github.com/repos/bbcmicrobit/micropython/issues{/number}","pulls_url":"https://api.github.com/repos/bbcmicrobit/micropython/pulls{/number}","milestones_url":"https://api.github.com/repos/bbcmicrobit/micropython/milestones{/number}","notifications_url":"https://api.github.com/repos/bbcmicrobit/micropython/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/bbcmicrobit/micropython/labels{/name}","releases_url":"https://api.github.com/repos/bbcmicrobit/micropython/releases{/id}","deployments_url":"https://api.github.com/repos/bbcmicrobit/micropython/deployments","created_at":"2015-08-07T11:58:53Z","updated_at":"2016-06-08T03:51:00Z","pushed_at":"2016-06-10T08:48:06Z","git_url":"git://github.com/bbcmicrobit/micropython.git","ssh_url":"git@github.com:bbcmicrobit/micropython.git","clone_url":"https://github.com/bbcmicrobit/micropython.git","svn_url":"https://github.com/bbcmicrobit/micropython","homepage":"","size":19260,"stargazers_count":149,"watchers_count":149,"language":"C","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":58,"mirror_url":null,"open_issues_count":60,"forks":58,"open_issues":60,"watchers":149,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/bbcmicrobit/micropython/pulls/302"},"html":{"href":"https://github.com/bbcmicrobit/micropython/pull/302"},"issue":{"href":"https://api.github.com/repos/bbcmicrobit/micropython/issues/302"},"comments":{"href":"https://api.github.com/repos/bbcmicrobit/micropython/issues/302/comments"},"review_comments":{"href":"https://api.github.com/repos/bbcmicrobit/micropython/pulls/302/comments"},"review_comment":{"href":"https://api.github.com/repos/bbcmicrobit/micropython/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/bbcmicrobit/micropython/pulls/302/commits"},"statuses":{"href":"https://api.github.com/repos/bbcmicrobit/micropython/statuses/53d6229f60fa39b88b5269e8d9326a7a575f61de"}}}}
{"actor":{"display_login":"ntoll"}}