SyedArslanHaider / Coursework-Planner

Your coursework planner
0 stars 0 forks source link

[TECH ED] CYF Blocks #8

Closed SyedArslanHaider closed 3 months ago

SyedArslanHaider commented 3 months ago

@SallyMcGrath cloned issue Migracode-Barcelona/Course-Fundamentals#28 on 2024-07-05:

Link to the coursework

https://blocks.codeyourfuture.io/

A note on ordering

This exercise should be done after the Code.org coursework in the same sprint. The reason for this is that the Code.org course will give you skills which will help you with this coursework - this coursework depends on the other coursework.

In the future, we won't always call out dependencies between coursework - just like in real life as a software engineer, part of your sprint planning is about working out the best order to do different tasks. When planning, you should consider what the best order of approaching tasks will be.

Why are we doing this?

In this course, you will use block-based programming (CYF Blocks) to create JavaScript that changes the HTML on a web page. Work through the exercises in order, up to and including Buttons, inputs and clicks: a todo list.

You must at least attempt all those exercises before we meet. If you get stuck, don't worry. Come to the session with your questions and we will all discuss them together.

Maximum time in hours

8

How to get help

If you get stuck, don't worry. Come to the session with your questions and we will all discuss them together.

How to submit

Once you're finished, share your solution to List of links by pasting the (very long!) url onto a comment on your copy of this ticket.

Copy one URL per comment.

How to review

Share your solution on with your cohort on your cohort's slack channel and ask for critique.

Anything else?

If you have extra time, complete one of the exercises in Buttons and Clicks: consolidation (or create something entirely new) and share it with your cohort in the Slack channel.

Write down some questions to bring up next week.

SyedArslanHaider commented 3 months ago

Exercise 1 : Modifying HTML dynamically: changing text

https://blocks.codeyourfuture.io/#exercise_change_text

https://blocks.codeyourfuture.io/share.html?v=('j!('blocks!('languageVersion!0~blocks!%5B('type!'on_start'~id!'%25ktF*VM*PTKzb_%2CwB5w%60'~x!-40~y!16~fields!('TEXT1!'at%20the%20start%20%7Bwhen%20run%20is%20clicked%7D')~inputs!('HANDLER%7FGtCOzCy%3F00e'%3ADP41N-8%7C%C2%83ID!'adjective%22!'M_%7D%3FiO%231c80ksT%3D%3F%2FCRZ%26kx%7CLpM%5B%2556%240M9xs*%60-'%3A%C2%83TEXT!'small')))))))~next%7F%241%7ChsZRiAtbK2%2C*Y7jQs%C2%83ID!'noun1%22!'%2C'l4NZgC6lzW3Kg(phk0n%26BDI3714jMgU-%7CAWMu%2F.2%C2%80'~id!'k%5BlWqEu%7B%5EZx%60c%5B%3Bc%2F9dz%C2%81~next%7FsgY-g%60foA%5D2h%40uTR-6cA%C2%83ID!'verb%22!'xC%3D%5E_O9T35%2Bg(V-0%3AJ%40L%26y%24xXwInEik%60p9BT%606%3DnI%C2%80'~id!'%5D28J%2Fw%3DcwC%23UZ0LzRRpd%C2%81~next%7FRGTCC%2FF(%7BD.%248%5Dex%5D_ab%C2%83ID!'noun2%22!'l%5DC%2CbsEUq6%25Mptf5MLpy%26%3B)za1%2C'%2BMk4%25L%2CD0%3F%25%5EQf%C2%80'~id!'*8%5D.'%3AK56%2BEIX8XDo3y4Z%C2%81))))))))))%5D))~h!'%20%20%20%20%20%20%3Cp%3E%5Cn%20%20The%C2%82noun1%5C'%3Edog%3C%2Fu%3E%C2%82verb%5C'%3Esaw%3C%2Fu%3E%20the%C2%82adjective%5C'%3E___%3C%2Fu%3E%5Cn%20%C2%82noun2%5C'%3Ecat%3C%2Fu%3E%5Cn%3C%2Fp%3E')%22')~inputs!('STACK!('%C2%84set_content'~id%26'~inputs!('VALUE!('shadow!('type!'text'~id!'%7F!('%C2%84with_element_by_id'~id!'%C2%80%C2%83TEXT!''))~%C2%84get_randomWord%C2%81%C2%83TYPE!'WORD')))))))%C2%82%20%3Cu%20id%3D%5C'%C2%83'~fields!('%C2%84block!('type!'%01%C2%84%C2%83%C2%82%C2%81%C2%80%7F%26%22_

Image

SyedArslanHaider commented 3 months ago

Ecercise 2 : Modifying html dynamically: setting colours

https://blocks.codeyourfuture.io/#exercise_set_colours

https://blocks.codeyourfuture.io/share.html?v=('j!('blocks!('languageVersion!0~blocks!%5B('type!'on_start'~id!'*EP%3Fl%2C'6gp9VgyQ%5Deu-%24h'~x!82~y!2%7FTEXT1!'at%20the%20start%20%7Bwhen%20run%20is%20clicked%7D%C2%84HANDLER%C2%80!3m5v%3AF%7BXgK8oUd%7B2%7D00'%7FID!'banana%C2%84STACK%26P%5B%23nQ4fNi%3A%2C'w%5D.%2C'N%3AtVp%C2%86%22er'~id!')%60Xso_6'%3A1%2F8%3FA%5BRAG.r%24'%C2%82c0c0c0'))))~next%26TGYlYKM%25K_qN%7CCM%2BVuig%C2%83c%22er'~id!'i%5E%23%23%24b4Lj%3A%3Am2GYYP5%24~%C2%82ffff33')))))))))~next%C2%80'HGXYww_Q4%3D%23SW1C.%2C'm_d'%7FID!'apple%C2%84STACK%26%3B%2CRYai'%3Ala9'%3A%5EV%40X%5EFsfe%C2%86%22er'~id!'gijb%7C1vX-CQ5gfWIL42%2B%C2%87%26eZoj%7DMG54QxD5pxg5o5g%C2%83c%22er'~id!'hW(w47A%2FSAh%2BiB%25Ob)J5'%C2%82ff0000')))))))))~next%C2%80'_PAVI0V%23JMaZcDxtEDoz'%7FID!'strawberry%C2%84STACK%26O%5EfQ92%25%3F%5EUY4L7*hM%2C'Na%C2%86%22er'~id!'%2B9ok%3D%2C3%2C'cq%7Bla2h%60XhZ6%C2%87%26JJ%3BCRf3%2C'%3BL%3Bh.%3F%7C%2C'g%5D%2B%2F%C2%83c%22er'~id!'%2C'ZZ1%5EpB944%7B%2BnR%2C'Johci'%C2%82000099')))))))))))))))))%5D))~h!'%20%3Cul%C2%81banana%5C'%3EBanana%3C%2Fli%C2%81apple%5C'%3EApple%3C%2Fli%C2%81strawberry%5C'%3EStrawberry%3C%2Fli%3E%5Cn%3C%2Ful%3E')%22olor%C2%84VALUE%C2%85colour_pick%26%C2%85set_attribute'~id!'%7F~fields!('%C2%80%C2%85with_element_by_id'~id!%C2%81%3E%5Cn%20%20%3Cli%20id%3D%5C'%C2%82%7FCOLOUR!'%23%C2%83'%7FPROPERTY!'%C2%84')~inputs!('%C2%85!('block!('type!'%C2%86%C2%83backgroundC%C2%87'%C2%82999999'))))~next%01%C2%87%C2%86%C2%85%C2%84%C2%83%C2%82%C2%81%C2%80%7F%26%22_

Image

SyedArslanHaider commented 3 months ago

Exercise : 3 Creating html dynamically: lists of fruit

https://blocks.codeyourfuture.io/#exercise_add_fruit

https://blocks.codeyourfuture.io/share.html?v=('j!('blocks!('languageVersion!0~blocks!%5B%7Fon_star%2CkQcW2s%3D%3FyM674o%23kRX%2BJ'~x!172~y!-3ZTEXT1!'at%20the%20start%20%7Bwhen%20run%20is%20clicked%7D')%5EHANDLER%26with_element_by_id'~id!'eWS4fb%2B-5M886.%3A%5DLWIX'ZID!'listOadd_elemen%2C8(HDcFME9tz%24a%23%7BRzBLa'Z%60conten%2Cm%2FP%5D%3A3q%40L%25_%23l%3B2GGv8A%22AeY*os%5B%7DUU%3DtjQdpFa43'ZTEXT!'banana')))))))~next%26add_elemen%2CHq%7C%3A-%2BoNM_-x.%24mA%2FL1%40'Z%60conten%2C%25HL.W(%3FDRn5t5h2oG.PW%22%23jb%7Dr_7GkUc%5B0T-Te%7D%23G'ZTEXT!'mango'))))))))))))))))%5D))~h!'%20%20%20%20%20%20%3Cul%20id%3D%5C'list%5C'%3E%5Cn%20%20%3Cli%3EApple%3C%2Fli%3E%5Cn%3C%2Ful%3E')O')%5ESTACK%26Z~fields!('%22'%5EVALUE!('shadow!%7Ftex%2C%26!('block!%7F%2Ct'~id!'%5E~inputs!('%60ELEMENT!'liOset_%7F('type!'%01%7F%60%5E%2C%26%22ZO_

Image

SyedArslanHaider commented 3 months ago

Exercise 4 : Creating html dynamically: lists of links

https://blocks.codeyourfuture.io/#exercise_list_links

https://blocks.codeyourfuture.io/share.html?v=('j!('blocks!('languageVersion!0~blocks!%5B('type!'on_start'~id!'%2C'W%2B%25LH6UYJ%5Dy)ydA'%3AkL('~x!121~y!-349~fields!('TEXT1!'at%20the%20start%20%7Bwhen%20run%20is%20clicked%7D')~inputs!('HANDLER%22with_element_by_id'~id!'Ex_85Sh%3A%3BG0)7WY%3FF%3FDg%26ID!'list%7F%C2%81KRD9O%7C%2C'VDgL%3A%7Dnj%3BAI-o%C2%85li%7F%C2%81V)Pe_)%3Amr9%7DXh.r3TnfR%C2%85a%7F%C2%86%40C5nA%5D%3FWA%7DnMt%23zw.O%2Cz%C2%88href%C2%82zEiV%2Bx%23%3FN7V%3DnwbTi%2BXz%C2%84studio.code.org%2Fhome%C2%83um%3B%5DlrLwJ34%24S%3DkP%2FGh*%C2%80tgzf65%40c%5EhPBnfcyt%5B3T%26TEXT!'codeorg'))%C2%87%3B5)dihF%2C%3FB%3AYKPQUGFZ%2B%C2%85li%7F%C2%81BF%3DJsWRwf%2B_%2CV5%7CTjc%3FD%C2%85a%7F%C2%86TS%2FSTy%7CY9L%60d2%7Bc.rHnL%C2%88href%C2%82p)tt%3Db7m%2F0%5DC.Hz.BkAd%C2%84www.facebook.com%2F%C2%83d%5BX%3DY2%247T7i%7DN%7B%2B%2FHGf%5D%C2%80%60T%5B%3D%7DQ4xd%5EyYRn5r)z%2C%25%26TEXT!'Facebook'))%C2%87huSW%5D%250Q1YnPukRoe%5E.a%C2%85li%7F%C2%81U%60mqgdNvkOIR4qK%3D%259%248%C2%85a%7F%C2%86Fc%3Bv%23%5B%7C%2CEKUwf9%2C'r%7BfAP%C2%88src%C2%82yUD%7Bh7%24*%7B)xoZt%7BKb%3FOB%C2%84www.netflix.com%2Fes-en%2F%C2%83MiP7%7C3H4K%3F%40TGe%3D%25V%5DqR%C2%80AXnW%3AwFCDC%60rGqE(g%248s%26TEXT!'Netflix')))))))))))))))))))))))%5D))~h!'%3Cul%20id%3D%5C'list%5C'%3E%5Cn%20%5Cn%3C%2Ful%3E')%22!('block!('type!'%26'~fields!('%7F')~inputs!('STACK%22%C2%80'~inputs!('VALUE!('shadow!('type!'text'~id!'%C2%81add_element'~id!'%C2%82')~inputs!('VALUE%22text'~id!'%C2%83'))))~next%22set_content'~id!'%C2%84%26TEXT!'https%3A%2F%2F%C2%85%26ELEMENT!'%C2%86set_attribute'~id!'%C2%87))))))))))~next%22%C2%81%C2%88%26PROPERTY!'%01%C2%88%C2%87%C2%86%C2%85%C2%84%C2%83%C2%82%C2%81%C2%80%7F%26%22_

Image

SyedArslanHaider commented 3 months ago

Exercise 5 : Buttons and clicks: A button to add apples

https://blocks.codeyourfuture.io/#exercise_button_add

https://blocks.codeyourfuture.io/share.html?v=('j!('blocks!('languageVersion!0~blocks!%5B%3BWmq0N(q%606XV(R035vTBQ'~x!37~y!12.tton9%26H%5B%5BnsZ%3FI%5BBw%7BXvh(4LmH'OID!'list-add_J%23oDahbe%7CPmxNz%5EubN5mqw'OELEMENT!'li-set_content%23%2FA%3DE%5EwYCC%60x%24)I%2CK'%3AsWN'%7DVALUE!('shadow!('type!'text%23PGq)fF%401%2CtaNbq)6Zk%3Dw'OTEXT!'Apple'))))))))))))))%2C%3BNpNKVx6AaApy%60%2BwIN%7BT2'~x!37~y!177.tton19%26N%25d%5B45)%2Cl*jQ4Y_ITc*r'OID!'list-remove_contents%23*H8kRQ%3F5HmDdAZmR%24%2BVN')))))))%5D))~h!'%20%20%20%20%20%20%3Cul%20id%3D%5C'list%5C'%3E%3C%2Ful%22%5C'%3Eadd%20an%20apple%3C%2Fbutton%221%5C'%3Eemove%7Fcontents%20of%7FJ%3C%2Fbutton%3E')-')%7DSTACK!('block!('type!'.OTEXT1!'when%7FJ%20with%20id'~ID!'bu9'~TEXT2!'is%20clicked')%7DHANDLER!('block!('JelementO~fields!('%22%3E%5Cn%3Cbutton%20id%3D%5C'button%23'~id!'%26type!'with_J_by_id%23%3B('type!'J_clicked%23%7D~inputs!('%7F%20the%20%01%7F%7D%3B%26%23%22OJ9.-_

Image

SyedArslanHaider commented 3 months ago

Exercise 6: Inputs and clicks: say something

https://blocks.codeyourfuture.io/#exercise_button_input

https://blocks.codeyourfuture.io/share.html?v=('jMblocksMlanguageVersion!0~blocks!%5B('type!'z_clickedW%3BJY7bcpB%24ChPxe%25L6%7D%2FQ'~x!-16~y!27vTEXT1!'when%20the%20z%20with%20id'~ID!'q'~TEXT2!'is%20clicked')~OsMHANDLER3with_z_by_idWgTG.*A%3F7Re.ll%2BgU%2C'PSV'v%23~OsMSTACK3text_to_speechW%3B5G2Gg%5BD%3Fb%7C9RZ%60e8%5B%2C8'~OsMVALUE3get_O_data_with_idW_E4F%3BAm'%3AY%3B%2CxI_JP%2CD_6'vTYPE!'string'~%23))))))))))%5D))~h!'%20%20%20%20%20%20%3CO%22text%5C'%20%2F%3E%5Cn%3Cq%22q%5C'%3Espeak%3C%2Fq%3E')3MblockMtype!'M!('OinputW'~id!'qbuttonv~fieldsMzelement%22%20id%3D%5C'%23ID!'text')%01%23%22zvqWOM3_

Image

SyedArslanHaider commented 3 months ago

Exercise 7 : Buttons, inputs and clicks: a todo list

https://blocks.codeyourfuture.io/#exercise_todo_list

https://blocks.codeyourfuture.io/share.html?v=('jZblocksZlanguageVersion!0~blocks!%5B('type!'v_clickedQjdr%2Fa1(f2-hYs%2C''%3At*Vp%2B'~x!22~y!169TEXT1!'when%20the%20v%20with%20id'~ID!'%22'~TEXT2!'is%20clicked')BHANDLERZ7with_v_by_idQ_'%3Afoy(%2BstetFhTn5)JMa'9ID!'list%25add_vQ(-NFP6Ka-%5EoLD2FC%7DT%2CI'9ELEMENT!'li%25set_contentQi%24Y%24sx%23%3DOSHdz%23-btSN%7B'BVALUEZshadowZtype!'textQ2*-.%2C'r4%3A8GF%7C_DwzAHCH'9TEXT!''))~7get_input_data_with_idQhjH4ach6CM%603SF%3BV(Kee'9TYPE!'string'~ID!'text'))))))))))))))%5D))~h!'%20%20%20%20%20%20%3Cp%3EThings%20to%20do%3A%3C%2FpqulWlist%5C'%3E%3C%2FulqinputWtext%5C'%20%2Fq%22W%22%5C'%3Eadd%20Todo%20Item%3C%2F%22%3E')7blockZtype!'9~fieldsZB~inputsZQ'~id!'W%20id%3D%5C'Z!('q%3E%5Cn%3Cvelement%22button%25')BSTACKZ7%01%25%22vqZWQB97_

Image

SyedArslanHaider commented 3 months ago

Exerciese 8 : Buttons and clicks consolidation

https://blocks.codeyourfuture.io/#exercise_button_consolidation

https://blocks.codeyourfuture.io/share.html?v=('j!('blocks!('languageVersion!0~blocks!%5B%C2%90%23%60cEu((Zqk%2C'%5D3_8zy%5DHb'~x!77~y!7%22noun1%26%C2%8AWD%5E%2C'%2BRomum34w%25j5o%5D1v%C2%84af6lNY6y%5Eksu%3B6h%2F%7CnO%5E%C2%82'~id!''%3A1Ahdq5%5E*BXj%3Ay2%5Dx%2C'O(%C2%92NOUN'%7Fg(31udYzz68%2B5GyyL%7B%2B%2F'~x!80~y!77%22verb%26%C2%8A2iCB1FjLz.0XJEA%5E%233G%7C%C2%84%7Cbtfd3%25rL0T7%3Dt*_BC1%3F%C2%82'~id!'X3LaPj%23e%602lRz%23nIVcUJ%C2%92VERB'%7FjzBI)%7B%7BZQW'%3A%3AStWscxm4'~x!79~y!147%22adjective%26%C2%8A5W%5DXy7%40heQ150la)1_xp%C2%84m%2Fb%2C'%3D%3BUjz7Fc(hqZ%2FFCl%C2%82'~id!'%5EcTZm%7C%25Og%7Cb%3F)J)%2C'y%5E4Z%C2%92ADJECTIVE'%7F*q%25bsX%5D%24L%25%3F.%2C'N%2CtYPJ1'~x!80~y!210%22noun2%26%C2%8AxOG7oRgrGadDxDe%5D%3Fk98%C2%84j%23%3Bn%2C'fp*U'%3A9%7Bx2%3AmN%3Av%5D%C2%82'~id!'-%3Bf%5DsKCZ%3FuW2td%7B4TnKm%C2%92NOUN'%7FYnO%3Ds%2CnKaFf%3F%40%7C%25qaIu)'~x!89~y!283%22day%26%C2%8C%24%24%25_%60WJNxHcyi-0%2B%7B%2F%5EB%C2%88%C2%839y%3ALX%3FD%2367(S*L3%7C52xT%C2%8Ec%C2%80er'~id!'%25-%7C(KUD%2B_E%5Bk8bJOjyUK%C2%8Dcccccc'))))~next%C2%83jJtM%7B%3Afooa%5ErA%7B_QKf76%C2%8EbackgroundC%C2%80er'~id!'s_W%23J0%5Dv%5E'%3A%40O%3Fub%7Bx%2482%C2%8D99ffff')))))%7Fs13Tzsg.3%3Fy8uv5bgy%2C'%23'~x!89~y!421%22night%26%C2%8CF%40t*Ai%3D7%600%5E%604w.h%5BRqe%C2%88%C2%83%3BfGQ98d%60Wa%3Aanld%60%3Bb%25s%C2%8Ec%C2%80er'~id!'t%7Cy%2CL%3AS%40%24v%25-%2C2trX%24D%2B%C2%8D3333ff'))))~next%C2%83v*L%24NhAC*ipOAeB9'%3A*WV%C2%8EbackgroundC%C2%80er'~id!'Vfz%24(SbV%3A%3BUj3MHKS8%5Dj%C2%8D00cccc')))))%7F0SndwK%7B%5E%3DI1CkP5i%2C%3BoC'~x!90~y!565%22block%26%C2%8CSt6(v%7C%2C'D%3AXa5K%7DPH72bg%C2%88%C2%83D3dd_0%2C'DOeHA-%2C'Ivv.A~~fields!('PROPERTY!'c%C2%80er'~id!'mY-%40A8r3Ui%40W7%25Cbm%7BT%7D%C2%8Dff0000')))%7F8%7Di-m%2F9gr%7B6%3AJt.HD4ka'~x!93~y!677%22imagebutton%26%C2%93!(%3Buw)y%40f8Tl%3Fgk-aiyV%C2%8Esrc%C2%8Ftext'~id!'I%25wTt%5DT0Y)-7HymW9L%25s%C2%86TEXT!%C2%8B%C2%89rock-singer-tom-petty-in-concert-george-rose.jpg'))))))))%5D))~h!'%20%20%20%20%20%20%3Cp%3E%5Cn%20%20The%20%C2%85noun1%5C'%3Edog%C2%87%20%C2%85verb%5C'%3Esaw%C2%87%20the%5Cn%20%20%C2%85adjective%5C'%3Ewhite%C2%87%5Cn%20%20%C2%85noun2%5C'%3Ecat%C2%91ul%20id%3D%5C'listdark%5C'%3E%C2%81%3E%5Cn%C2%81%3E%C2%81%3E%3C%2Ful%3E%5Cn%3Cp%3E%C2%85day%5C'%3EDay%20Mode%C2%87%5Cn%C2%85night%5C'%3ENight%20Mode%C2%91p%3E%C2%85block%5C'%3Echange%20blocks%C2%87%3C%2Fp%3E%5Cn%C2%85imagebutton%5C'%3E%5Cn%3Cimg%20src%3D%5C%C2%8B%C2%891-rock-and-roll-musician-elvis-presley-michael-ochs-archives.jpg%5C'%20alt%3D%5C'imageclick%5C'%3E%3C%2Fimg%3E%C2%87')%22~fields!('TEXT1!'when%20the%20element%20with%20id'~ID!'%26'~TEXT2!'is%20clicked')~inputs!('HANDLER!('block!('%7F))))))))%2C%C2%90%C2%80olor%C2%8Fcolour_pick%C2%81%3Cli%3Eshould%20be%20dark%20text%20on%20a%20light%20background%3C%2Fli%C2%82%C2%86TEXT!''))~block!('type!'get_randomWord%C2%83!('block!('%C2%93'%C2%84'~inputs!('VALUE!('shadow!('type!'text'~id!'%C2%85%3Cbutton%20id%3D%5C'%C2%86'~fields!('%C2%87%3C%2Fbutton%3E%C2%88%C2%86ID!'listdark')~inputs!('STACK%C2%89ered%2Fdefault%2Fprint%2Fimages%2Fartworkimages%2Fmedium%2F2%2F%C2%8Atype!'set_content'~id!'%C2%8B'https%3A%2F%2Frender.fineartamerica.com%2Fimages%2Frend%C2%8Ctype!'with_element_by_id'~id!'%C2%8D%C2%86COLOUR!'%23%C2%8E%C2%86PROPERTY!'%C2%8F')~inputs!('VALUE!('block!('type!'%C2%90('type!'element_clicked'~id!'%C2%91%C2%87%5Cn%3C%2Fp%3E%5Cn%3C%C2%92%C2%86TYPE!'%C2%93type!'set_attribute'~id!%01%C2%93%C2%92%C2%91%C2%90%C2%8F%C2%8E%C2%8D%C2%8C%C2%8B%C2%8A%C2%89%C2%88%C2%87%C2%86%C2%85%C2%84%C2%83%C2%82%C2%81%C2%80%7F%26%22_

Image

SyedArslanHaider commented 3 months ago

Exercise 9 : Variables: keeping track of the number of clicks

https://blocks.codeyourfuture.io/#exercise_button_variables_state

https://blocks.codeyourfuture.io/share.html?v=('j!('blocks!('languageVersion!0~blocks!%5B('type!'on_start'~id!'o*.Sk6PUQeBz%3F%3Fp%24PNsN'~x!74~y!12%26TEXT1!'at%20the%20start%20%7Bwhen%20run%20is%20clicked%7D%C2%80variables_set'~id!'%7C6mSh2%2C'%7B6g%3B%7BSH.Cfz%7D%2BY~inputs!('VALUE!('%22math_number'~id!'a%23O%3D%23%3B-m%25By%3BPk8i%5E.%5DT'%26NUM!0))))))))%2C('type!'element_clicked'~id!'%3FZ*ZU5%2FA%5Eeu%245%24%40KUc%2C'%60'~x!73~y!89%26TEXT1!'when%20the%20element%20with%20id'~ID!'click-count'~TEXT2!'is%20clicked%C2%80math_change'~id!'r%60e4rnIc7(F_ogpAtPq%2BY~inputs!('DELTA!('shadow!('type!'math_number'~id!'PZ%5EFXZFR%60%60Eq%5EXgaA%239m'%26NUM!1))))~next!('%22set_content'~id!'%3B)QWWvtdX56%3AE)%7Dh.My.'~inputs!('VALUE!('shadow!('type!'text'~id!')yq%5ElU%3Fks-c7%40Hu9V%7B%7Dv'%26TEXT!''))~%22variables_get'~id!'%60GpW%5B%2BUzJ2.%2Bdjwu(2*8Y)))))))))%5D)~variables!%5B('name!'click-count'~%7F%5D)~h!'%20%20%20%20%20%20%3Cbutton%20id%3D%5C'click-count%5C'%3Ecounter%200%3C%2Fbutton%3E')Y'%26VAR!('%7F)%22block!('type!'%26~fields!('%7Fid!'S%2B-CO6L%5Et%2BncWJyab7QP')%C2%80')~inputs!('HANDLER!('%22%01%C2%80%7F%26%22Y_

Image

SyedArslanHaider commented 3 months ago

Exercise 10 : Variables consolidation: counting sheep

https://blocks.codeyourfuture.io/#exercise_button_variables_consolidation

https://blocks.codeyourfuture.io/share.html?v=('j!('blocks!('languageVersion!0~blocks!%5B('type!'element_clicked'~id!'qx%2CasU%60(xv%7C%40p)'%3A5ed(x'~x!-51~y!-242~fields!('TEXT1!'when%20the%20element%20with%20id'~ID!'button'~TEXT2!'is%20clicked')%C2%84HANDLER%C2%8D.*Wa%2C'qNqvb%25%3F*%40**o%40eL%C2%89'X8mCbOO.Dx%3B%5B%7C9Fdn0m)%26OP!'EQ')%C2%84%C2%881.ax27QJn%7B9ABAj7sFKP%26%C2%85'~id!'O%7Dah3Z%40%7CT0UF%2C'IOAH%25%5DV%26%C2%86nt_by_id'~id!'zW%3Dm%405bx%3F%2C'F)-1s%2FG-NL%26ID!'sheep%C2%8Age'~id!'CHeOf%5B4UjZ5OM'%3AQAIHwn%26VAR!('%7F%C2%80!'RWW'%3AXOaG78oOtM%2C_2k%2CZ%26%C2%87E%3FnO%23(7jf%2B*7UNwduXHP%C2%82%7D%2Cn593.gxwX)%605n'%3Az5E_%26%C2%83qS3BO2v%3Fo%3FsBz%7BX-%3A%3AQ%2C'%26VAR!('%7F))))))))))))~next%C2%8DeM*KS%3D7z5MDY5R%40%25q%5E9U%C2%89'D%3F%40CB-%25bn%5ElPdg5mn%2F0F%26OP!'NEQ')%C2%84%C2%88%3F0oh7_7_'%3AWMz*Kl%7B%7D%2F%24U%26%C2%85'~id!'r1J4%2FJ%5B%2FgA6KpR8%40%2C%2CU7%26%C2%86nt_by_id'~id!'0%3AhL%2BY3%3F6%2C'_oi67vxxT4%26ID!'other%C2%8Age'~id!'UK5%2CWAS%7Bhab6I3%3DPpnX%40%26VAR!('%C2%81%C2%80!'qCfjZJs%5E%7B%5Dc*i'%3AJn'%3Agtb%26%C2%87hYXoGj%5Dt%3BNqvpCuRzUd%7C%C2%82nYBe9J%5El3%7B0-%3Fp%7B2.o-9%26%C2%83%5BmCh%60kIPE%40U09j.NB(bI%26VAR!('%C2%81))))))))))))))))))%5D)~variables!%5B('name!'sheep'~%7F%2C('name!'other'~%C2%81%5D)~h!'%20%20%20%20%20%20%3Cp%3EThere%20have%20been%20%3Cspan%C2%8Csheep%C2%8Bsheep%20%F0%9F%90%91%20and%20%3Cspan%C2%8Cother%C2%8Bothers.%3C%2Fp%3E%5Cn%3Cinput%C2%8Ctext%5C'%20%2F%3E%5Cn%3Cbutton%C2%8Cbutton%5C'%3Eadd%20animal%3C%2Fbutton%3E')%22!('block!('type!'%26'~fields!('%7Fid!'4%3DGl%3DO%2Fpt%7B6%5DtYkX%2C'e%2C%2C'')%C2%80)%C2%84DELTA!('shadow!('type!'math_number'~id%C2%81id!'YyTtXr0M*F0(peU6Z9hR')%C2%82'%C2%84VALUE!('shadow!('type!'text'~id!'%C2%83TEXT!''))~block!('type!'variables_get'~id!'%C2%84~inputs!('%C2%85TYPE!'string'~ID!'text')))~B%22text%C2%86TEXT!'sheep'))))))~DO0%22with_eleme%C2%87NUM!1))))~next%22set_content'~id!'%C2%88A%22get_input_data_with_id'~id!'%C2%89'%C2%84IF0%22logic_compare'~id!%C2%8A_count')%C2%84STACK%22math_chan%C2%8B_count%5C'%3E0%3C%2Fspan%3E%20%C2%8C%20id%3D%5C'%C2%8D%22controls_if'~id!'%01%C2%8D%C2%8C%C2%8B%C2%8A%C2%89%C2%88%C2%87%C2%86%C2%85%C2%84%C2%83%C2%82%C2%81%C2%80%7F%26%22_

Image

SyedArslanHaider commented 3 months ago

Exercise 11: Arrays: Mad Libs revisited

https://blocks.codeyourfuture.io/#exercise_arrays_random

https://blocks.codeyourfuture.io/share.html?v=('j!('blocks!('languageVersion!0~blocks!%5B%C2%8Ew%2BC%7C%25W1Uf%604A_V%2FCVdi~~x!41~y!11%26%C2%82%7F%C2%8AjW%23%40wU%5Er%2Cb8Mj%2C's4%7CIFL'%26VAR!('%C2%81)%7F%C2%89kned%3AkmotI%5Bb%3FrYb%5DtET%C2%88%C2%850e8BwQCiM9iE%3AK%5BW%2Bcpg%C2%8DHorse')))~ADD1%C2%85%2F%25U4o%2Cq%3F%3Bs%5BQ%5ETy8x%7D%2B%25%C2%8DDog')))~ADD2%C2%85Qu%2C2%3A%60B%5ED7m%3B31f%2C'C*SG%C2%8DElephant%C2%87~id!'u_N984n8AKUA%7D%7C%60(s%3A%25P'%26ID!'animal%C2%8B!'XiZ-XH%25%5EwtFVS%40vtJ%2F%2CY%C2%86%5Ea%258bmB%23E%7Cb4%253%2C'y3qPJ'%26%C2%83Y1o%2B%40f%7DqM)%5BJAv_%60MSBc%C2%8Cd!'Fr)Lp%3Fb%605B%2C'utWl_OL%2CY'%26VAR!('%C2%81))))))))))))))))%2C%C2%8ErE3Y4vS%7B-WkCx7xB%7C*xu'~x!47~y!206%26%C2%82%7F%C2%8Ar%7CKFS%2BXpK%24yPjfD%25%5Dv%2BC'%26VAR!('%C2%80)%7F%C2%89HOBOuJ1aZD-dHau6EE%7Cz%C2%88%C2%85l%7DvK5k%2B%5BNRB%2FE5veX%5BTO%C2%8Dbrown')))~ADD1%C2%85*W%40A%3A.Ov%60GZV6b2%2FU%2C'%60%60%C2%8Dblack')))~ADD2%C2%85_u-C%2Fgk6H%7D6c%5Eu88%60MS%7D%C2%8Dwhite%C2%87~id!'3f%3Da2zc%60V4(%5BkXAuHu%24R'%26ID!'adjective%C2%8B!'uxquirvCYaLLQvXERvso%C2%865RnJ%2C'GoitPPH2%3DhWm%5B%24.'%26%C2%83j5J(iDvWGuMz5%2F%25K-iq%3D%C2%8Cd!'.dC%2Fg%6019%7C0o%5B)M%7D%2C_%5Bwv'%26VAR!('%C2%80))))))))))))))))%5D)~variables!%5B('name!'animals'~%C2%81%2C('name!'adjective'~%C2%80%2C('name!'array'~id!'Pd7%2C%23XDIbpnTA%23vGc'%3AeW')%5D)~h!'%20%20%20%20%20%20%3Cp%3EThe%C2%84noun%5C'%3Eman%3C%2Fu%3E%C2%84verb%5C'%3Esaw%3C%2Fu%3E%20the%C2%84adjective%5C'%3Ewhite%3C%2Fu%3E%C2%84animal%5C'%3Ecat%3C%2Fu%3E%3C%2Fp%3E')%22!('block!('type!'%26~fields!('%7F~inputs!('%C2%80id!'Tl%25%7CdH4clh%7D%2C%3BBS%24WIKO')%C2%81id!'%2C'D4%7DWH3z%60%2CS3t)zZLPq%23')%C2%82TEXT1!'at%20the%20start%20%7Bwhen%20run%20is%20clicked%7D')%C2%83TEXT!''))~block!('type!'get_randomMember'~id!'%C2%84%20%3Cu%20id%3D%5C'%C2%85%22text'~id!'%C2%86'%7FVALUE!('shadow!('type!'text'~id!'%C2%87')))))))~next%22with_element_by_id'%C2%88'~extraState!('itemCount!3)%7FADD0%C2%89VALUE%22lists_create_with'~id!'%C2%8AHANDLER%22variables_set'~id!'%C2%8B')%7FSTACK%22set_content'~id%C2%8C'%7FARRAY%22variables_get'~i%C2%8D'%26TEXT!'%C2%8E('type!'on_start'~id!'%01%C2%8E%C2%8D%C2%8C%C2%8B%C2%8A%C2%89%C2%88%C2%87%C2%86%C2%85%C2%84%C2%83%C2%82%C2%81%C2%80%7F%26%22_

Image

SyedArslanHaider commented 3 months ago

Exercise 12 : Arrays and loops

https://blocks.codeyourfuture.io/#exercise_arrays_foreach

https://blocks.codeyourfuture.io/share.html?v=('j!('blocks!('languageVersion!0~blocks!%5B('type!'on_start'~id!')M*XBB%2BS%3B%3A7iJFa%3D22l*'~x!-48~y!9%7FTEXT1!'at%20the%20start%20%7Bwhen%20run%20is%20clicked%7D')%C2%80HANDLER%26variables_set'~id!'R%5Dya%3B_%2C'T%25%3F2%25P.)gfUzF%22%C2%80VALUE%26lists_create_with'~id!'fmBljh%3Af0IP5%5D%2CaWr5%2C'W'~extraState!('itemCount!3)%C2%80ADD0%26text'~id!'Pu%24%2C'rsUN2Kb%2BEYpyjwYq'%7FTEXT!'apple')))~ADD1%26text'~id!'U4%5DB)%2C'Riup%2BG4a13o%2BOd'%7FTEXT!'banana')))~ADD2%26text'~id!!%24y%7B%40%2C'IpzA%23Rq%7C8%249M%3A%7B'%7FTEXT!'orange')))))))~next%26with_element_by_id'~id!'P(cK(0gi-60dBC1XK%3FzE'%7FID!'list')%C2%80STACK%26arrays_forEach'~id!'2%7B%5DLY7h%2B%5BqM%2Bdq2s5%243m%22%C2%80LIST%26%C2%82j4%5Bc%5EQ%60R%3D20-omHc%2C'm%5B'%3A%22))~DO%26add_element'~id!'.*Ks%24BlKBo)0%5EnHmhG.v'%7FELEMENT!'li')%C2%80STACK%26set_content'~id!'L%2C'%5BAkz)%3DC8vl3'%3AvL6K%24%3F'%C2%80VALUE!('shadow!('type!'text'~id!'aRnUoU%3B%3Az%5B15Kka%2B*q%23)'%7FTEXT!''))~block!('type!'%C2%82%60g_2Rq%2C'Vkk*%5Exsl(Z%2Brd%22))))))))))))))))))%5D)~variables!%5B('name!'fruits'~%C2%81%2C('name!'array'~id!'6%25fy%25fGtznCAZQ8%2CCDy%5B')%2C('name!'item'~id!'(NS%5DoX%5DJ%2C'f-%23A%3BPo1(wz')%5D)~h!'%20%20%20%20%20%20%3Cul%20id%3D%5C'list%5C'%3E%3C%2Ful%3E')%22'%7FVAR!('%C2%81)%26!('block!('type!'%7F~fields!('%C2%80~inputs!('%C2%81id!')aaH9LsQV9Y9p0%2FENJdC')%C2%82variables_get'~id!'%01%C2%82%C2%81%C2%80%7F%26%22_

Image

SyedArslanHaider commented 3 months ago

Exercise 13 : Arrays and buttons

https://blocks.codeyourfuture.io/#exercise_arrays_buttons

https://blocks.codeyourfuture.io/share.html?v=('j!('blocks!('languageVersion!0~blocks!%5B('type!'on_start'~id!'bge%24ZI%25iJ%5B_%3D%3AmR%5D%2BS%3AC'~x!-17~y!9%7F1!'at%20the%20start%20%7Bwhen%20run%20is%20clicked%7D')%C2%80HANDLER%22variables_set'~id!'K-M48v7AF%3Fh1v%40ID%60%2C)g%26%C2%80VALUE%22lists_create_with'~id!'fd1RDTu7azpeu(J8m7v'%3A'~extraState!('itemCount!4)%C2%80ADD0%C2%82B%5DtuTUla'%3A'%3A)6YC(L2P1%7B'%7F!'mango')))~ADD1%C2%82N%24'%3AbTl%60vJEFF%23e*89t%3Ft'%7F!'apple')))~ADD2%C2%82Ny)n%3DC)wGyuLaFN3ZaDd'%7F!'strawberry')))~ADD3%C2%82%2Bq)JD%7B'%3AOk%24b%2CJ863WdJn'%7F!'pineapple')))))))))))%2C('type!'element_clicked'~id!'%23%5E1%5D%7C%5DYTJYU%605E.I%3BvkH'~x!-19~y!170%7F1!'when%20the%20element%20with%20id'~ID!'button'~TEXT2!'is%20clicked')%C2%80HANDLER%22with_element_by_id'~id!'LT%2B%40%25lLy%5E0Il8Ll6bd*e'~fields!('ID!'list')%C2%80STACK%22controls_if'~id!'63lY%24%3B%7BRTXJJ%2Co9ZfAj6'%C2%80IF0%22logic_negate'~id!'(lA%2BHwEdjg%24*%7Bp%3F49tWu'%C2%80BOOL%22lists_isEmpty'~id!'PVQ2p%2Frzfgx1p5m0%2CD%2Cb'%C2%80VALUE%22%C2%83P%3BrqWH0*)Y%2F%5ED1y%2C'%23*w%7C%26))))))))~DO0%22add_element'~id!'2%7DfTn%7DTW7_%60HV6x'%3Ab%24y%7D'~fields!('ELEMENT!'li')%C2%80STACK%22set_content'~id!'9k1KQ%3Dqf3%242%3DPh-%7C1)'%3A%3F'%C2%80VALUE!('shadow!('type!'text'~id!'lD%7CV%60Q%605%2B7PnnlTMU%60%5By'%7F!''))~block!('type!'%C2%835Yja%2F*fdFxasc.Lp.aes%26))))))))))))))))%5D)~variables!%5B('name!'fruits'~%C2%81%2C('name!'array'~id!'F(%7DK%3DdV%2C%3D%25%2C'fE%7DnST6k%3B')%2C('name!'item'~id!'MrJ2EgK7A%7DkVVf%2BhkLVO')%5D)~h!'%20%20%20%20%20%20%3Cul%20id%3D%5C'list%5C'%3E%3C%2Ful%3E%5Cn%3Cbutton%20id%3D%5C'button%5C'%3Ereveal%20next%20fruit%3C%2Fbutton%3E')%22!('block!('type!'%26'~fields!('VAR!('%C2%81)%7F~fields!('TEXT%C2%80~inputs!('%C2%81id!'pfj%3Dd%7DRT%3AW_WBfVmg%60St')%C2%82%22text'~id!'%C2%83variables_get'~id!'%01%C2%83%C2%82%C2%81%C2%80%7F%26%22_

Image

SyedArslanHaider commented 3 months ago

Exercise 14: Loops and arrays: more fun with fruit

https://blocks.codeyourfuture.io/#exercise_array_while_loops

https://blocks.codeyourfuture.io/share.html?v=('j!('blocks!('languageVersion!0~blocks!%5B('type!'on_start'~id!'..r4j%5BmL%5E1%7DEAn7G%5BR%3Dq'~x!52~y!13%26TEXT1!'at%20the%20start%20%7Bwhen%20run%20is%20clicked%7D')%C2%83HANDLER%C2%8CwT_%2FGjl%3BP-%3F%7D%2Cp%3DI(Y4Q%C2%8B%7F)%C2%83%C2%88cXaQReAcO%2CB%5DtTMXF%23Lw%C2%86%C2%82-%23t%23SQ%7Btv3%3DIU2E%5EUgXD%C2%8Amango')))~ADD1%C2%824pgXEL%25TJ%3FWq2E%2C2_ybi%C2%8Abanana')))~ADD2%C2%82%3F%23nan%2Bi1ZFn%2B%2BUsfkPI%5D%C2%8Agrapes')))~ADD3%C2%82UX9%5B%3B%7D%7BEznkQ7%5EAo47un%C2%8Acoco')))))))~next%C2%8COK%3A%7CfYU%3Bn.TAx0Q2tZe2%C2%8B%C2%81)%C2%83%C2%88z%3Bh3KBQ3U%60%2C%7D%2F%2Fm9%2C'z-)%C2%86%C2%82epb%2BINv%40%25R%2BH13t%7C8KQT%C2%8A%F0%9F%A5%AD')))~ADD1%C2%827e5zUM)4*gLhz%2C'NB%5EIg%2F%C2%8A%F0%9F%8D%8C')))~ADD2%C2%82%23nZ%250eF'%3AN%5BDPBp0b%607-u%C2%8A%F0%9F%8D%87')))~ADD3%C2%82R2O9%40%7CO%2C24Ua%7Bp%23Re-h~%26TEXT!'%F0%9F%A5%A5')))))))))))))%2C('type!'with_element_by_id'~id!'tZ%2C'wHYUR0'%3A%2C'hU0%7B%5E60mB'~x!50~y!280%26ID!'list')%C2%83STACK%22controls_whileUntil'~id!'%7DW9iRxmjg32e%25%7C%24)E6.2'%26MODE!'UNTIL')%C2%83BOOL%22lists_isEmpty'~id!'k%3Ax60%7CqB)t%5E%60Fh)9Sy%23s'%C2%80!'c0Gy%2CF%7Ca'%3ALr%3A%5B%7Dw4l1f_%C2%8B%7F))))))~DO%C2%8DSNCPv%40xVuImm%2B*i%7C3p_j'%26ELEMENT!'li%C2%89!'Bal3E%7B0%7C%5BA%2C'_fm%60ELr4R%C2%850%7C%5DKLd1jf6LDA(._%2BELl'%26%C2%84jNc9d%5Bw%7CVy%3F0Y%3B2a%7B%3F%3D%C2%87%C2%80!'r)%7D8C%2C'XNtezn2Sy%5DEZI'%3A%C2%8B%7F))))))))))~next%C2%8Dj7FsKNIL2kr%7Ca0b2l2cY'%26ELEMENT!'span%C2%89!'WAS'%3A*yQTzc%3FLD*c%23ZsPk%C2%85bLIo0rc%3Ds%60r%25%3AI%2Ck%40%2C'o_'%26%C2%84ACct3mL4Q6%3A%2C'Jog%3BmQy%C2%87%C2%80!'LYC)%25NWOB%23o%25g81%24c%7BkO%C2%8B%C2%81)))))))))))))))))))%5D)~variables!%5B('name!'fruits'~%7F%2C('name!'emoji'~%C2%81%2C('name!'i'~id!'%5B%7CSrYLNe1ia%60C15JcIh%23')%2C('name!'array'~id!'B%5D%25p%40h%2B2n17%5BBxCrpQ7d')%5D)~h!'%20%20%20%20%20%20%3Cul%20id%3D%5C'list%5C'%3E%3C%2Ful%3E')%22!('block!('type!'%26~fields!('%7Fid!'(%5BLO390hB0%2Fu.%252QV%2F6n')%C2%80%C2%83VALUE%22variables_get'~id%C2%81id!'_mfD-u0mES_G%3A18%3AT%24iz')%C2%82%22text'~id!'%C2%83~inputs!('%C2%84TEXT!''))~block!('type!'arrays_getFirst'~id!'%C2%85'%C2%83VALUE!('shadow!('type!'text'~id!'%C2%86'~extraState!('itemCount!4)%C2%83ADD0%C2%87~%26MODE!'GET_REMOVE'~WHERE!'FIRST')%C2%88VALUE%22lists_create_with'~id!'%C2%89')%C2%83STACK%22set_content'~id%C2%8A'%26TEXT!'%C2%8B'%26VAR!('%C2%8C%22variables_set'~id!'%C2%8D%22add_element'~id!'%01%C2%8D%C2%8C%C2%8B%C2%8A%C2%89%C2%88%C2%87%C2%86%C2%85%C2%84%C2%83%C2%82%C2%81%C2%80%7F%26%22_

Image

SyedArslanHaider commented 3 months ago

Exercise 15 : Arrays: Adding, removing, and summing elements

https://blocks.codeyourfuture.io/#exercise_arrays_add_sum

https://blocks.codeyourfuture.io/share.html?v=('j!('blocks!('languageVersion!0~blocks!%5B('type!'on_start'~id!'%3B%5Ez%2C'M%2CI)1%7Da%3B3qC%3FLFAI'~x!-39~y!0%7FTEXT1!'at%20the%20start%20%7Bwhen%20run%20is%20clicked%7D')%C2%81HANDLER%22variables_set'~id!'t_vh%2COzDl%5DQ_rCys0q%7C%3A%26%C2%85%22lists_create_with'~id!'Tr61l%25%40)%3Borc82fx'%3A%3Bj%23'~extraState!('itemCount!5)%C2%81ADD0%C2%80%3BDT6cR%40y11oq8%7D%5BJxg9i%C2%831%C2%80%40s3YJt%24Z%2B%5EW%3FdoM%40Tep%7C%C2%832%C2%80%2CaObx%60JDwq%3Dq4(9Q%60uC%40%C2%833%C2%80aAiu6%5Dk%5BLLJUlPt-eIhy%C2%834%C2%80%23FJ04'%3A%5D%3Fl%7B%25P9Q%40t8%7Dym'%7FNUM!0)))))))))))%2C('type!'element_clicked'~id!'CVe6%7CBXtN.UHx1h%2CWSp%25'~x!-44~y!186%7FTEXT1!'when%20the%20element%20with%20id'~ID!'add_number'~TEXT2!'is%20clicked')%C2%81HANDLER%22with_element_by_id'~id!'WsCmv%60Cd%40ul9%23c%7BOy%5Evw'%7FID!'total')%C2%81STACK%22set_content'~id!'%2CnOi%2F%40Rby2u4xYcROE%3BH'%C2%85!('shadow!('type!'text'~id!'G(o_p4%5E%7DA)Z%2BPCMFS.Z%3B'%7FTEXT!''))~block!('type!'get_sum'~id!'t9O%3Fqeb%2C'%3Ar%24%24qee%5DUbBC'%C2%81ARRAY%C2%82%3DX'%3AciDD_g%3FHlPXz%25B%5BW-%26)))))))))~next%22arrays_push'~id!'kmf-a'%3Ap6d%3ApM.E%3D%2Cm7XV'%7FWHERE!'END')%C2%85%22get_input_data_with_id'~id!'q(%7B.%25Kws0%2C%258%2C'Z7vRiH%60'%7FTYPE!'number'~ID!'number')))~LIST%C2%82%258-kh-5agX'%3A8%7DFX%7DG1Z(%26)))~next%22arrays_getFirst'~id!'o%25-rJXc%5Dw%2Fq%7DY%5D'%3Af(pU)'~extraState!('isStatement!true)%7FMODE!'REMOVE'~WHERE!'FIRST')%C2%85%C2%82Z'%3A%2C'2W%2FBi%3AX1%3FWN%2FOiQCG%26)))))))))))%5D)~variables!%5B('name!'numbers'~%C2%84%2C('name!'array'~id!'z9K4*x%2Fb%3BLKQ1RatdHsn')%5D)~h!'%20%20%20%20%20%20%3Cp%3ETotal%20of%20the%20last%205%20numbers%3A%20%3Cspan%20id%3D%5C'total%5C'%3E%3C%2Fspan%3E%20%3C%2Fp%3E%5Cn%3Cinput%20id%3D%5C'number%5C'%20%2F%3E%5Cn%3Cbutton%20id%3D%5C'add_number%5C'%3Eadd%20value%3C%2Fbutton%3E')%22!('block!('type!'%26'%7FVAR!('%C2%84)%7F~fields!('%C2%80%22math_number'~id!'%C2%81~inputs!('%C2%82%22variables_get'~id!'%C2%83'%7FNUM!0)))~ADD%C2%84id!'Z1%24UuZO7xf%25%25ecYdCYTR')%C2%85%C2%81VALUE%01%C2%85%C2%84%C2%83%C2%82%C2%81%C2%80%7F%26%22_

Image

SyedArslanHaider commented 3 months ago

Exercise 17: Project: Don't go higher than 11! https://blocks.codeyourfuture.io/#exercise_arrays_sum

https://blocks.codeyourfuture.io/share.html?v=('j!('blocks!('languageVersion!0~blocks!%5B('type!'on_start'~id!'Aixmepdx4%3DpJgyx%5Dd%5Eyw'~x!-158~y!-188%7FTEXT%C2%89HANDLER%C2%8FMgQl07tLmHxvWS0a%3AQ%2B4%26%C2%83%C2%8B*m%3D%5B_PY%25Y6l%25L'%3Abdw%23%604%C2%8D0)%C2%82~id!'%5E'%3A%2FjK%7CyiihAyr(H7hU9C%C2%80%C2%93on_start'~id!'3%5DGo-%2C'(dy%5BMD)CF%2C'3zBC'~x!-159~y!-83%7FTEXT%C2%89HANDLER%C2%8F_M5dks%23cT%5EaABQTK%2C'.Y7'%7FVAR!('%C2%8A)%C2%83%C2%8B9%5E0%7Dp70tTjgtHQV%2F%5B%3DMO%C2%8D6)%C2%83ADD0%C2%84%2ClCA)Ot%5Ed%3FUm%3DB%3FD%3BH.Q'%7FNUM!1)))~ADD1%C2%84Z'%3AfU%25t_%7BPs%40%25%3A%3Fx1'%3A_7%60'%7FNUM!2)))~ADD2%C2%84RgJ9TE%25.X.Nz)'%3A'%3A*%7BiAm'%7FNUM!3)))~ADD3%C2%84J%40%3BcP%60D2l%3B.5%25%23%247A%3F*('%7FNUM!4)))~ADD4%C2%84LhskZ%5Ebq%3B2yUI%2BW%3FbmTT'%7FNUM!5)))~ADD5%C2%84QQl'%3AQ4I8%2C'9x%25%2C'%2CV%7B%3Al%7D9'%7FNUM!6)))%C2%85l%3D0W%3DmXUN2vJ%7BVW%23GW)U'~x!-165~y!144%7F%C2%81oll%C2%88%22arrays_push'~id!'mLTfkO%2CqE%7DUwGdl%3BWv_a'%7FWHERE!'END')%C2%83VALUE%22get_randomMember'~id!'Ic1dy%3BCoN%2BmqkUmX%7DyB%3B'%C2%83ARRAY%C2%86cPU*vAvW%7Cyl%40U1ER%60r*_'%7FVAR!('%C2%8A))))))~LIST%C2%861FF5%24%25%25D7amxutzkUy%401%26%C2%82~id!'fUk%25w%5BJH'%3AD.53l29*5%2C'o%C2%80%C2%93procedures_defnoreturn'~id!'riB%3F%5BvVxrE%24necY%7Bb4VE'~x!-166~y!-301~icons!('comment!('text!'Describe%20this%20function...'~pinned!false~height!80~width!160))%7FNAME%C2%92%C2%83STACK%C2%8CN6.4trGy%5B%23zxT%7D-z%23ssw'%7FID!'total%C2%91!'qMtOTrk6vz'%3ANzjEP'%3A'%3A%2B%40%C2%8EBR%3D0P7DmXby2XgqXA'%3A7k%C2%94get_sum'~id!'*hN5SYx%2Ct%2C'.v1%3BvB%3D%40Zb'%C2%83ARRAY%C2%86WOwl*uox%25kAQ0felp9a%24%26)))))%C2%85%25%24%2Ca7td8_(8*C%2432dQz.'~x!-171~y!269%7F%C2%81emove%C2%88%C2%98UwYX%60owL99%2C'njc%3D-QZqY%C2%97isStatement!true)%7FMODE!'REMOVE%C2%95%C2%86GboW%5Dc%7C%2CQu%24W(b%5D%25i)aV%26)))~next%22controls_if'~id!'eoqQBXria%7DN)h)Q5)%7BSm'%C2%83IF0%22logic_compare'~id!'%3BPPfEd6%7D6%5B%2F%40kjr%40K%5Ecd'%7FOP!'EQ')%C2%83A%C2%98'%3A%60wmj%2C'%2FR%5Eil%2C'OP%24Rc8Fz'%7FMODE!'GET%C2%95%C2%86MO6-%2Bj9suB8uLd-3aKks%26)))))~B%C2%84h%3AiMeMOGKY%3A%25'%3AY)yfhhx'%7FNUM!11))))))~DO0%C2%8ChIDfs8D9CixNC%24GRvDJU'%7FID!'info%C2%91!'HT)%3D%23OCM8.Lbu%2C'4)%2C_EQ%C2%8E%7B%3FvdGsKIg%5E*qV.O2%7D7GP%C2%94text'~id!'wu.qmYcC%24fiIBQ%3B%3A(%5EnE'%7FTEXT!'you%20won')))))))%C2%82~id!'%2FmJdRs%24%2FN*d%3BMpt%5DU%23W%40%C2%80%C2%85%60I_VPe%7Cx%3A3%2B1A%60UYHNY%5B'~x!-187~y!557%7F%C2%81estart%C2%88%C2%8FkU%3DE1rz%3A%257*XABnOp%5BYi%26%C2%83%C2%8Bf9%3Fd%2C%23d'%3A%3Bzd%2FpGE7%7CbRA%C2%8D0)%C2%82~id!'9X9H%3Fl%236%5D%23)%40s%60uNbG*3%C2%80~next%C2%8C%25%5B%60Kdvk%5DbL52%230w7%23%5Dg9'%7FID!'list')%C2%83STACK%22remove_contents'~id!'V%24k3G%24_SxP_n45*cN_h%2F')))))))))))%5D)~variables!%5B('name!'dice'~%C2%8A%2C('name!'rolls'~%C2%90%2C('name!'array'~id!'3.CMs5nHV.(V8F63ppbX')%5D)~h!'%20%20%20%20%20%20%3Cp%3ESo%20far%20you%20have%20rolled%3A%3C%2Fp%3E%5Cn%3Cul%C2%96list%5C'%3E%3C%2Ful%C2%87oll%5C'%3ERoll%20the%20dice%3C%2Fbutton%3E%5Cn%3Cp%3ETotal%3A%20%3Cspan%C2%96total%5C'%3E0%3C%2Fspan%3E.%20%3Cspan%C2%96info%5C'%3EKeep%20playing'%3A%3C%2Fspan%3E%3C%2Fp%C2%87emove%5C'%3ERemove%20the%20last%20roll%3C%2Fbutton%C2%87estart%5C'%3EStart%20again%3C%2Fbutton%3E')%22!('block!('type!'%26'%7FVAR!('%C2%90)%7F~fields!('%C2%80%C2%97name%C2%92%C2%81TEXT1!'when%20the%20element%20with%20id'~ID!'button_r%C2%82)))~next%22procedures_callnoreturn'%C2%83~inputs!('%C2%84%22math_number'~id!'%C2%85))%C2%93element_clicked'~id!'%C2%86%22variables_get'~id!'%C2%87%3E%5Cn%3Cbutton%C2%96button_r%C2%88'~TEXT2!'is%20clicked')%C2%83HANDLER%C2%891!'at%20the%20start%20%7Bwhen%20run%20is%20clicked%7D')%C2%83%C2%8Aid!'WJYfcoAf'%3Ak%2FE.HLVv7%5Ew')%C2%8BVALUE%22lists_create_with'~id!'%C2%8C%22with_element_by_id'~id!'%C2%8D%C2%97itemCount!%C2%8E'%C2%83VALUE!('shadow!('type!'text'~id!'%C2%8F%22variables_set'~id!'%C2%90id!'zYROH4kyv8%3A%7C'%3Av%40%24SxE7')%C2%91')%C2%83STACK%22set_content'~id%C2%92!'for%20display%20the%20roll')%C2%93))))))%2C('type!'%C2%94'%7FTEXT!''))~block!('type!'%C2%95'~WHERE!'LAST')%C2%83VALUE%C2%96%20id%3D%5C'%C2%97'~extraState!('%C2%98%22arrays_getFirst'~id!'%01%C2%98%C2%97%C2%96%C2%95%C2%94%C2%93%C2%92%C2%91%C2%90%C2%8F%C2%8E%C2%8D%C2%8C%C2%8B%C2%8A%C2%89%C2%88%C2%87%C2%86%C2%85%C2%84%C2%83%C2%82%C2%81%C2%80%7F%26%22_

Image

SyedArslanHaider commented 3 months ago

Exercise 17 : Project: Select a random facilitator

https://blocks.codeyourfuture.io/#exercise_random_facilitator

https://blocks.codeyourfuture.io/share.html?v=('j!('blocks!('languageVersion!0~blocks!%5B('type!'%C2%8B6t%7B5VWyfYjvn%2C%40%2C%5ED%23xp'~x!200~y!1%C2%81add-button%C2%83%22%C2%87%5BahV%7D-%248wRUTlfl%5D%7CG%5EF'%7FID!'list-names%C2%85add_element'~id!'_(8yK7Z%3F)ZMmHN%5EaK%40_%23'%7FELEMENT!'li%C2%85arrays_push'~id!'V3%3B6myRJu%7DD.zqV8R)Tx'%7FWHERE!'END%C2%80VALUE%22get_input_data_with_id'~id!'g3o'%3Afj%3D%2B%23%5B%5E*f)CosRO%2C''%7FTYPE!'string'~ID!'text')))~LIST%C2%88%5DpBYj%3B2%24q%2C'dOF%2Fqu7%2CH%60%C2%89)))))%C2%84on_start'~id!'g%2F8k4%3DI.Kg%7C3cx%2BYE4HV'~x!204~y!-72%7FTEXT1!'at%20the%20start%20%7Bwhen%20run%20is%20clicked%7D%C2%80HANDLER%22variables_set'~id!'C9%2Cpd7%5BZC0Jp.Y.%5Et53i%C2%89~inputs!('VALUE%22lists_create_with'~id!'WoDPAAT%2BLDRl%5BIW_-%2C'XB'~extraState!('itemCount!0%C2%84procedures_defnoreturn'~id!'tkP%60%3Fsz-A%5D5%60'%3A%2C'yHO%2Caa'~x!200~y!194~icons!('comment!('text!'Describe%20this%20function...'~pinned!false~height!80~width!160))%7FNAME%C2%8A%C2%85%C2%87RG%409u%2C%7DMR40V%2B%60bIq8%3AA'%7FID!'random-name%C2%85set_content'~id!'Ej%5E0G)%2Fxq-%23ysFu%5D*Z3%7D'~inputs!('VALUE!('shadow!('type!'text'~id!'v%3DS%3B8%2FD9%3F%3B82pshKbst3'%7FTEXT!''))~block!('type!'get_randomMember'~id!'qCd%7D_k9fLYIQjv0i%24%2Cb%5D'~inputs!('ARRAY%C2%88i9%2F%2FVi%3F5bg)IR%3A-Jry)y%C2%89)))))%C2%84%C2%8Buuck'%3AaCiH9%25(%24u'%3AXKutU'~x!200~y!309%C2%81facilitator%C2%83%22procedures_callnoreturn'~id!'-ju%7DR9zs--9Mj%5EmtcEmB'~extraState!('name%C2%8A')))))%5D)~variables!%5B('name!'list-names'~%26%2C('name!'array'~id!'%25BAm)Rq5%40eMJrp*9Dlvf')%5D)~h!'%20%20%20%20%20%20%3Cp%3EEnter%20names%3C%2Fp%3E%5Cn%3Cinput%20type%3D%5C'text%5C'%C2%86text%5C'%3E%5Cn%3Cbutton%C2%86add-button%5C'%3Eadd%C2%82list-names%5C'%20%3E%3C%2Ful%3E%5Cn%5Cn%3Cp%3EPress%20button%20to%20display%20names%20from%20the%20list.%3C%2Fp%3E%5Cn%3Cbutton%20type%3D%5C'selector%5C'%C2%86facilitator%5C'%3Eselect%20facilitator%C2%82random-name%5C'%3E%3C%2Ful%3E')%22!('block!('type!'%26id!'**9%24%7D%40P%5EBi'%3ABQ%5EaILMGP')%7F~fields!('%C2%80')~inputs!('%C2%81%7FTEXT1!'when%20the%20element%20with%20id'~ID!'%C2%82%3C%2Fbutton%3E%5Cn%3Cul%C2%86%C2%83'~TEXT2!'is%20clicked%C2%80HANDLER%C2%84))))))))%2C('type!'%C2%85%C2%80STACK%22%C2%86%20id%3D%5C'%C2%87with_element_by_id'~id!'%C2%88%22variables_get'~id!'%C2%89'%7FVAR!('%26)%C2%8A!'get%20random%20name%C2%8Belement_clicked'~id!'%01%C2%8B%C2%8A%C2%89%C2%88%C2%87%C2%86%C2%85%C2%84%C2%83%C2%82%C2%81%C2%80%7F%26%22_

Image