{"functions":[],"name":"Rock-Paper-Scissor game","main":{"rawId":"main","tpe":"Void","name":"main","statements":[{"@type":"Begin","id":"id_0b679ec8_6b8e_4648_97a5_48986d36ebbd"},{"lengthValue":-1,"@type":"Declare","lengthValue1":"5","tpe":"Integer","name":"menuChoice","lengthValue2":"5","id":"id_a0a69b89_b2b3_42b0_a967_dffc4e82f824","initValue":"0"},{"condition":"(menuChoice != 1) && (menuChoice != 2)","@type":"While","id":"id_510ae96e_6ae2_45f1_a9ff_f47ff1c90dd5","body":{"statements":[{"newline":true,"@type":"Output","id":"id_e5e601bd_728f_447e_b9e5_ff5775ffe074","value":"\"Welcome to Rock-Paper-Scissors-Lizard-Spock!\""},{"newline":true,"@type":"Output","id":"id_b86e7681_bdc8_46ef_ab2a_933fcb9deb8b","value":"\"1 = Proceed to Play\""},{"newline":true,"@type":"Output","id":"id_935d8aae_3917_4aaf_ae34_cd6e21918772","value":"\"2 = See Instructions\""},{"@type":"Input","name":"menuChoice","id":"id_a74e2f69_da5d_4bc6_9a49_ca78a04c6710","prompt":"Enter your choice (1 or 2):"},{"falseBlock":{"statements":[],"id":"id_0203d224_54d8_4d44_9aaa_bb050cfe17f0"},"trueBlock":{"statements":[{"newline":true,"@type":"Output","id":"id_343df12c_1df6_4cf9_b517_72ef77bfa679","value":"\"Invalid choice. Please type 1 or 2.\""}],"id":"id_36e1df5c_6399_41bd_995d_f12392255dec"},"condition":"(menuChoice != 1) && (menuChoice != 2)","@type":"If","id":"id_9c7c4e76_819a_410e_9857_c47dac3de499"}],"id":"id_c4caf40e_4720_450a_81d1_d6b021e19e63"}},{"falseBlock":{"statements":[],"id":"id_d893b593_81c5_45c0_94c5_188193d67ba4"},"trueBlock":{"statements":[{"newline":true,"@type":"Output","id":"id_751c14c6_33ca_433a_a898_62cd96933ef9","value":"\"--- GAME INSTRUCTIONS ---\""},{"newline":true,"@type":"Output","id":"id_3ba5821c_f1ff_4661_a9b2_5cb1b70d513f","value":"\"Rock crushes Scissors and Lizard\""},{"newline":true,"@type":"Output","id":"id_9309e271_fe33_4130_b7a0_1bde9a66cfbf","value":"\"Paper covers Rock and disproves Spock\""},{"newline":true,"@type":"Output","id":"id_ac9685d8_9a87_4d4b_bccf_7fb0f68115ff","value":"\"Scissors cut Paper and decapitate Lizard\""},{"newline":true,"@type":"Output","id":"id_2a99136a_b6b2_4e1b_aa76_38632d79f7d0","value":"\"Lizard eats Paper and poisons Spock\""},{"newline":true,"@type":"Output","id":"id_43c74727_8a00_403b_bada_847b5643a088","value":"\"Spock smashes Scissors and vaporizes Rock\""},{"newline":true,"@type":"Output","id":"id_5948db71_3255_4572_8145_6ccb8d404bfe","value":"\" \""},{"@type":"Input","name":"menuChoice","id":"id_ea87e9a9_3716_4785_9f33_5f1592fa899c","prompt":"Type 1 to proceed to playing:"},{"condition":"menuChoice != 1","@type":"While","id":"id_9b954821_8e34_413a_bd69_37df3c1e702a","body":{"statements":[{"@type":"Input","name":"menuChoice","id":"id_096209eb_7425_4d51_b4b1_4dba9bb26dc1","prompt":"You must type 1 to start the game:"}],"id":"id_71888cad_88d6_4cae_be0b_90b22f0ef194"}}],"id":"id_8b8e8029_ca91_4ac2_9810_ef50462bd11c"},"condition":"menuChoice == 2","@type":"If","id":"id_16a12330_2829_4d3f_864a_0c8078e04397"},{"lengthValue":-1,"@type":"Declare","lengthValue1":"5","tpe":"Integer","name":"totalRounds","lengthValue2":"5","id":"id_d60be85e_92b4_42b8_a4df_533eb6b81b58","initValue":null},{"lengthValue":-1,"@type":"Declare","lengthValue1":"5","tpe":"Integer","name":"roundsLeft","lengthValue2":"5","id":"id_de1e7b2a_21d8_4b6c_a60e_8abf2dafdb6c","initValue":null},{"@type":"Input","name":"totalRounds","id":"id_1d4db041_1145_4652_ab6c_b2cb8a11b3c8","prompt":"Please enter Rounds you wanna play:"},{"@type":"Assign","name":"roundsLeft","id":"id_892d7f7c_4319_4090_b0a0_d0a5be2418c8","value":"totalRounds"},{"lengthValue":-1,"@type":"Declare","lengthValue1":"5","tpe":"Integer","name":"playerChoice","lengthValue2":"5","id":"id_b4682d04_67a3_4be0_a4a4_efc5da655d8f","initValue":null},{"lengthValue":-1,"@type":"Declare","lengthValue1":"5","tpe":"Integer","name":"playerScore","lengthValue2":"5","id":"id_9c2d684b_fb87_4297_b12d_c0ef5880cb2a","initValue":"0"},{"lengthValue":-1,"@type":"Declare","lengthValue1":"5","tpe":"Integer","name":"computerScore","lengthValue2":"5","id":"id_e3a4542e_4345_420b_b71c_865d97caac56","initValue":"0"},{"lengthValue":-1,"@type":"Declare","lengthValue1":"5","tpe":"Integer","name":"computerChoice","lengthValue2":"5","id":"id_1248305e_33e6_489b_b1d0_f9cac714a623","initValue":null},{"lengthValue":-1,"@type":"Declare","lengthValue1":"5","tpe":"StringArray","name":"moveNames","lengthValue2":"5","id":"id_a4ba6b31_0be6_4338_9499_9603fb9248a1","initValue":null},{"@type":"Assign","name":"moveNames[0]","id":"id_ec95360a_804b_4976_a211_b43241064f1b","value":"\"Rock\""},{"@type":"Assign","name":"moveNames[1]","id":"id_f136f574_a9f4_4ba3_929c_1db0343399a6","value":"\"Paper\""},{"@type":"Assign","name":"moveNames[2]","id":"id_48292841_5950_46c5_a896_9a6a4fefafc6","value":"\"Scissors\""},{"@type":"Assign","name":"moveNames[3]","id":"id_c4a09749_6df2_4d3c_b20d_af53df2c5b42","value":"\"Lizard\""},{"@type":"Assign","name":"moveNames[4]","id":"id_93899c4e_5258_4e56_b64b_3d824d59dbf3","value":"\"Spock\""},{"condition":"roundsLeft > 0","@type":"While","id":"id_bf381d44_315f_4dc9_96e3_3b5fb723eb7b","body":{"statements":[{"newline":true,"@type":"Output","id":"id_3ed5582f_1040_4074_a09d_e04b342119af","value":"\"Round: \" + ((totalRounds - roundsLeft) + 1)"},{"@type":"Assign","name":"computerChoice","id":"id_e089a75c_53c3_44dd_a09a_122ebeccf4a5","value":"randomInt(5) + 1"},{"newline":true,"@type":"Output","id":"id_1ed0fc68_2555_443a_b195_af32e8ba2ca7","value":"\"Please enter your choice:\""},{"newline":true,"@type":"Output","id":"id_8e641b50_3227_491a_9063_42e55eba2fd6","value":"\"1 = Rock\""},{"newline":true,"@type":"Output","id":"id_c1e6a2c9_d0cf_421c_b12a_749e525cf9fe","value":"\"2 = Paper\""},{"newline":true,"@type":"Output","id":"id_ef917702_3b82_4ce1_9552_59c0664b4c5a","value":"\"3 = Scissors\""},{"newline":true,"@type":"Output","id":"id_871888f2_fd9e_4333_8ab0_cad884c0c8b0","value":"\"4 = Lizard\""},{"newline":true,"@type":"Output","id":"id_4cf22efb_722b_4618_b3b8_cf7c8f0bea02","value":"\"5 = Spock\""},{"@type":"Input","name":"playerChoice","id":"id_0ae7e349_0f6c_4439_bdec_679fdd4b4b03","prompt":"Choice:"},{"condition":"playerChoice < 1 || playerChoice > 5","@type":"While","id":"id_17ae0b9b_0dea_4299_a7c3_4edb8e5e5831","body":{"statements":[{"newline":true,"@type":"Output","id":"id_7065c68d_3347_477b_ae26_0389d786c3e6","value":"\"Please enter correct number(1-5)\""},{"@type":"Input","name":"playerChoice","id":"id_0cb9809b_b81e_4795_b005_40d1c6615e26","prompt":"Choice:"}],"id":"id_bd88d1d4_cc88_4c69_a4a3_ab2622b92cab"}},{"newline":false,"@type":"Output","id":"id_d71d4b57_e0eb_464e_a971_38ce36689bbc","value":"\"You chose: \""},{"newline":false,"@type":"Output","id":"id_45be4ec7_dcb6_4de5_8e1b_79f17da03fd8","value":"moveNames[(playerChoice - 1)]"},{"newline":false,"@type":"Output","id":"id_daac4e28_155f_4d39_9826_c39749f5afcc","value":"\" | Computer chose: \""},{"newline":true,"@type":"Output","id":"id_8faa818c_dda5_441a_b3df_94e02de01a57","value":"moveNames[(computerChoice - 1)]"},{"falseBlock":{"statements":[{"falseBlock":{"statements":[{"@type":"Assign","name":"computerScore","id":"id_fe7d4ff0_35ff_4554_9b7b_230acfdcc483","value":"computerScore + 1"},{"newline":true,"@type":"Output","id":"id_124f9a5b_95e1_47e0_8c06_39ef5964f3a8","value":"\"Computer won this round.\""}],"id":"id_c5c0f59e_a399_4164_9f07_e05158df8af0"},"trueBlock":{"statements":[{"@type":"Assign","name":"playerScore","id":"id_8b299b66_a4fd_4af2_a254_fc8651c7a3f7","value":"playerScore + 1"},{"newline":true,"@type":"Output","id":"id_48608219_7585_4b01_8402_1fb2d2710641","value":"\"You won this round.\""}],"id":"id_7d55dab0_a3ef_470d_ad41_7a1033a00cdb"},"condition":"(playerChoice == 1 && (computerChoice == 3 || computerChoice == 4)) || (playerChoice == 2 && (computerChoice == 1 || computerChoice == 5)) || (playerChoice == 3 && (computerChoice == 2 || computerChoice == 4)) || (playerChoice == 4 && (computerChoice == 2 || computerChoice == 5)) || (playerChoice == 5 && (computerChoice == 1 || computerChoice == 3))","@type":"If","id":"id_0fecdfb0_b9ff_42ba_a608_5343337b0967"}],"id":"id_b189581c_19b2_4188_b93c_d4b6431e6e75"},"trueBlock":{"statements":[{"newline":true,"@type":"Output","id":"id_78f37d71_3e13_4f00_bfe5_2afeb8346d4d","value":"\"it's a tie\""}],"id":"id_199e2567_e3f4_433a_98fb_7430ed07a857"},"condition":"playerChoice == computerChoice","@type":"If","id":"id_056578bb_98fb_4e6f_8a36_ba6be94eeeef"},{"newline":false,"@type":"Output","id":"id_03c03d91_3967_4d58_af53_6d7a5d7b9b14","value":"\"You won \""},{"newline":false,"@type":"Output","id":"id_22d2e9f1_a9f5_45b3_8705_b41d76f58aaa","value":"playerScore"},{"newline":true,"@type":"Output","id":"id_2c4c96fe_7832_459f_8a5b_83a225933718","value":"\" rounds.\""},{"newline":false,"@type":"Output","id":"id_a42bb87b_7cbe_48fb_afca_b9b3275a6f6d","value":"\"Computer won \""},{"newline":false,"@type":"Output","id":"id_f6e6a361_5c34_4a01_8844_1684bf570b8d","value":"computerScore"},{"newline":true,"@type":"Output","id":"id_824c55a0_8309_47d8_a16a_fc15731a704e","value":"\" rounds.\""},{"@type":"Assign","name":"roundsLeft","id":"id_22a5c616_f2c9_4267_8cc3_96271f4286df","value":"roundsLeft - 1"},{"newline":true,"@type":"Output","id":"id_2e0d11db_ccd1_4d80_9b7e_9885cf87ae82","value":"\"-----------\""}],"id":"id_2f050a8f_308a_4219_9672_51a56a2e2142"}},{"newline":false,"@type":"Output","id":"id_639a30ce_2ee3_4851_b976_28eed9c7a4ac","value":"\"You won \""},{"newline":false,"@type":"Output","id":"id_a3cafa31_bcaa_4d7c_94cb_aeb886b26f52","value":"playerScore"},{"newline":false,"@type":"Output","id":"id_19247ec1_53f5_4dcf_b253_7c97e044d48b","value":"\" rounds. Computer won \""},{"newline":true,"@type":"Output","id":"id_22ef74a6_0915_47a5_9570_c07dd19a2a97","value":"computerScore"},{"newline":false,"@type":"Output","id":"id_bd438f86_e39e_47c2_9e9a_b00b84f2c809","value":"\" out of \""},{"newline":false,"@type":"Output","id":"id_9021af30_7dbe_4bfe_b40f_a9b4ca815cba","value":"totalRounds"},{"newline":true,"@type":"Output","id":"id_3b65b72d_c450_498b_97c7_baf7e3b6b6bb","value":"\" games.\""},{"falseBlock":{"statements":[],"id":"id_85cd720b_679f_4f39_a898_a82cc4714a4d"},"trueBlock":{"statements":[{"newline":false,"@type":"Output","id":"id_2cc9b805_d95c_4fd7_a307_032e30f43ac2","value":"\" Remaining \""},{"newline":false,"@type":"Output","id":"id_3be52903_9bcd_4c27_a117_65fec832492f","value":"totalRounds - (playerScore + computerScore)"},{"newline":true,"@type":"Output","id":"id_f53c3b7a_b437_4b9d_b6ac_30f78942cd20","value":"\" were draws.\""}],"id":"id_d1d923ac_51f6_4dd9_ae1d_fbd2bdb9daab"},"condition":"(totalRounds - (playerScore + computerScore)) > 0","@type":"If","id":"id_c9670a22_1842_4e5c_a565_0010804df235"},{"falseBlock":{"statements":[{"falseBlock":{"statements":[{"newline":true,"@type":"Output","id":"id_7ad91fcc_ed29_4f30_b495_2d7a6fe12a45","value":"\"Computer won the game.\""}],"id":"id_6602d3b8_595e_4dc6_9955_3a5daeb08062"},"trueBlock":{"statements":[{"newline":true,"@type":"Output","id":"id_ea1242fb_ac5d_4d37_be91_05f0a7c9c679","value":"\"You won the game.\""}],"id":"id_4b7f72d2_2709_43d6_847b_a419c0c1f738"},"condition":"playerScore > computerScore","@type":"If","id":"id_8b267aa8_01f5_4201_b1ce_bbb5e3480263"}],"id":"id_ca4de0cc_9514_4ecc_8594_5a46305f5c43"},"trueBlock":{"statements":[{"newline":true,"@type":"Output","id":"id_a4147ce4_9d12_47c3_9806_f368b0b9bd78","value":"\"it's a overall tie.\""}],"id":"id_1ecc9757_c0d1_4b64_b01e_811a8c72fa64"},"condition":"playerScore == computerScore","@type":"If","id":"id_5b7f9500_2fe0_496f_8ee5_c7e953ac3ea2"},{"@type":"Return","id":"id_cf9aa64e_6d5f_4944_82f6_8e9f379e574d","maybeValue":null}],"parameters":[]},"id":"id_47d8c038_d588_4303_a403_7fcf6b04a6fe","config":{"showDebugVars":true,"useInputPrompt":true,"echoEnteredValue":true,"showIoBtns":true,"showFunctions":true,"lang":"javascript","showGenCode":true},"version":"0.3","revision":1808}