{"action":"created","issue":{"url":"https://api.github.com/repos/Microsoft/pxt/issues/1170","repository_url":"https://api.github.com/repos/Microsoft/pxt","labels_url":"https://api.github.com/repos/Microsoft/pxt/issues/1170/labels{/name}","comments_url":"https://api.github.com/repos/Microsoft/pxt/issues/1170/comments","events_url":"https://api.github.com/repos/Microsoft/pxt/issues/1170/events","html_url":"https://github.com/Microsoft/pxt/issues/1170","id":201598777,"number":1170,"title":"Only image literals supported here","user":{"login":"githubhero","id":1677287,"avatar_url":"https://avatars.githubusercontent.com/u/1677287?v=3","gravatar_id":"","url":"https://api.github.com/users/githubhero","html_url":"https://github.com/githubhero","followers_url":"https://api.github.com/users/githubhero/followers","following_url":"https://api.github.com/users/githubhero/following{/other_user}","gists_url":"https://api.github.com/users/githubhero/gists{/gist_id}","starred_url":"https://api.github.com/users/githubhero/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/githubhero/subscriptions","organizations_url":"https://api.github.com/users/githubhero/orgs","repos_url":"https://api.github.com/users/githubhero/repos","events_url":"https://api.github.com/users/githubhero/events{/privacy}","received_events_url":"https://api.github.com/users/githubhero/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2017-01-18T15:05:01Z","updated_at":"2017-01-18T16:03:05Z","closed_at":null,"body":"One question.\r\n\r\nI have a little array of \"leds\":\r\n\r\n```\r\nvar myLeds =[`\r\n    . . . . .\r\n    . # # # .\r\n    . # # # .\r\n    . # # # .\r\n    . . . . .\r\n    `, `\r\n    # # # # #\r\n    # # # # #\r\n    # # # # #\r\n    # # # # #\r\n    # # # # #\r\n    `, `\r\n    . . . # .\r\n    # . # . #\r\n    . # # # .\r\n    # . # . #\r\n    . . . # .\r\n    `];\r\n```\r\n\r\nI extract a random number this way:\r\n`var randomNumber = Math.random(3);`\r\n\r\nthen this line follows: \r\n```\r\nbasic.showLeds(myLeds[randomNumber]);\r\n```\r\n\r\nbut it throws an error (\"only image literals supported here\").\r\n\r\nWhy?\r\n\r\nI tried passing a simple variable and it works.\r\n\r\n```\r\n// this is ok\r\nvar myLed = `\r\n    # # # # #\r\n    # # # # #\r\n    # # # # #\r\n    # # # # #\r\n    # # # # #\r\n    `;\r\nbasic.showLeds(myLed);\r\n```\r\n\r\nHow am I supposed to do what I'm trying to do?   :-)\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/Microsoft/pxt/issues/comments/273517002","html_url":"https://github.com/Microsoft/pxt/issues/1170#issuecomment-273517002","issue_url":"https://api.github.com/repos/Microsoft/pxt/issues/1170","id":273517002,"user":{"login":"githubhero","id":1677287,"avatar_url":"https://avatars.githubusercontent.com/u/1677287?v=3","gravatar_id":"","url":"https://api.github.com/users/githubhero","html_url":"https://github.com/githubhero","followers_url":"https://api.github.com/users/githubhero/followers","following_url":"https://api.github.com/users/githubhero/following{/other_user}","gists_url":"https://api.github.com/users/githubhero/gists{/gist_id}","starred_url":"https://api.github.com/users/githubhero/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/githubhero/subscriptions","organizations_url":"https://api.github.com/users/githubhero/orgs","repos_url":"https://api.github.com/users/githubhero/repos","events_url":"https://api.github.com/users/githubhero/events{/privacy}","received_events_url":"https://api.github.com/users/githubhero/received_events","type":"User","site_admin":false},"created_at":"2017-01-18T16:03:05Z","updated_at":"2017-01-18T16:03:05Z","body":"Hi @pelikhan, if you are suggesting to modify my array this way:\r\n\r\n```\r\nvar myLeds = [images.createImage(`\r\n    . . . . .\r\n    . # # # .\r\n    . # # # .\r\n    . # # # .\r\n    . . . . .\r\n    `), images.createImage(`\r\n    # # # # #\r\n    # # # # #\r\n    # # # # #\r\n    # # # # #\r\n    # # # # #\r\n    `), images.createImage(`\r\n    . . . # .\r\n    # . # . #\r\n    . # # # .\r\n    # . # . #\r\n    . . . # .\r\n    `)];\r\n```\r\n\r\nit doesn't work (I get \"Argument of type 'Image' is not assignable to parameter of type 'string'\")."}}
{"actor":{"display_login":"githubhero"}}