{"id":43741,"student_id":1404,"content":"setBackdrop(\"space_bg.jpg\");\nvar earth = createSprite(\"earth.png\");\nvar cards = []\nvar chosen = []\nvar computerI, playerI;\nvar rounds = 0;\n\nearth.x = 50;\nearth.y = 440;\nearth.scale = 0.3; \n\n// Initialization of cards\n\nfor(var i = 2; i \u003c 11; i+=1){\n cards.push('Clubs ' + i);\n cards.push('Diamond ' + i);\n cards.push('Heart ' + i);\n cards.push('Spade ' + i);\n}\ncards.push('Clubs J', 'Diamond J', 'Heart J', 'Spade J',\n 'Clubs Q', 'Diamond Q', 'Heart Q', 'Spade Q',\n 'Clubs K', 'Diamond K', 'Heart K', 'Spade K',\n 'Clubs A', 'Diamond A', 'Heart A', 'Spade A');\n\n\n// Initialization of chosen\nfor(var i=0; i \u003c 52; i+=1){\n chosen.push(false); \n}\n\nearth.when('click', function () {\n while(chosen[computerI] !== false){\n computerI = Math.floor(Math.random() *52);\n }\n chosen[computerI] = true;\n while(chosen[playerI] !== false){\n playerI = Math.floor(Math.random() *52);\n }\n chosen[playerI] = true;\n rounds += 1;\n});\n\nforever(function(){\n print(\"Player: \" + cards[playerI], 0, 10, 'white', 40);\n print(\"Computer: \" + cards[computerI], 0, 60, 'white', 40);\n if(computerI \u003e playerI){\n print('You Lose!', 0, 110, 'white', 40);\n }\n else if(computerI \u003c playerI){\n print('You Win!', 0, 110, 'white', 40);\n }\n if(rounds == 26){\n print(\"End\", 300, 230, 'white', '40');\n stop();\n }\n})\n","created_at":"2018-09-30T08:25:46.504+08:00","updated_at":"2019-10-28T02:57:31.498+08:00","name":"Challenge1","language":"javascript","screenshot":{"url":"https://cdn6.koding.school/uploads/project/screenshot/43741/8c05d7c0581a9725e99c7a3a9b00f29e.jpg"},"parent_id":2,"plugin":"","description":null,"note":null,"status":"public","like_student_ids":[],"is_featured":false,"views":79,"hashid":"yeys4jg8","is_content_changed":false,"review_status":"unsubmitted","submitted_at":null,"reviewed_at":null,"advise":null,"is_deleted":false}
[{"id":768489,"file_name":"Gymnopedie_No_1.mp3","project_id":43741,"asset_id":86527,"created_at":"2018-09-30T08:25:46.513+08:00","updated_at":"2018-09-30T08:25:46.513+08:00"},{"id":768490,"file_name":"koding.png","project_id":43741,"asset_id":86714,"created_at":"2018-09-30T08:25:46.517+08:00","updated_at":"2018-09-30T08:25:46.517+08:00"},{"id":768491,"file_name":"space_bg.jpg","project_id":43741,"asset_id":86716,"created_at":"2018-09-30T08:25:46.519+08:00","updated_at":"2018-09-30T08:25:46.519+08:00"},{"id":768492,"file_name":"earth.png","project_id":43741,"asset_id":86717,"created_at":"2018-09-30T08:25:46.521+08:00","updated_at":"2018-09-30T08:25:46.521+08:00"}]
橘蘋學習平台
橘蘋學習平台
我的作品
檢視專案頁
匯出
複製
匯入
刪除
下載 Android APP (APK)
截圖
1:1:1
1:1
full
幫助
用手機掃描下方 QRCode 進行安裝
或您也可以
下載 APK
到這台電腦
用手機掃描下方 QRCode 進行安裝
或您也可以
下載 APK
到這台電腦