by @Veer Morjaria Fork
{"functions":[],"name":"Darts Game","main":{"rawId":"main","tpe":"Void","name":"main","statements":[{"@type":"Begin","id":"id_b23f22c9_7d77_43c2_9984_baa4819dec59"},{"newline":true,"@type":"Output","id":"id_e63bffaa_c082_4c17_acf3_3cc524a15c93","value":"\"This is a game of virtual darts. You enter your score and see how many darts it takes you reach 0!\""},{"lengthValue":-1,"@type":"Declare","lengthValue1":"5","tpe":"Integer","name":"points","lengthValue2":"5","id":"id_1ffd1326_cd4a_4b9a_a29e_f45fed5aaace","initValue":null},{"lengthValue":-1,"@type":"Declare","lengthValue1":"5","tpe":"Integer","name":"total","lengthValue2":"5","id":"id_ca1bc682_3c0a_4bf9_a459_52bce87d57b6","initValue":"101"},{"lengthValue":-1,"@type":"Declare","lengthValue1":"5","tpe":"Integer","name":"attempts","lengthValue2":"5","id":"id_3464c1fe_c5a8_4dd7_a567_2cbb36574c69","initValue":"0"},{"condition":"total > 0","@type":"While","id":"id_1e254501_e4bc_4417_92a8_aafc689afd26","body":{"statements":[{"newline":true,"@type":"Output","id":"id_c7b0dc62_eac0_42cb_85cf_e02909f5fc51","value":"\"How many points did you score (pick between 1 and 20)?\""},{"@type":"Input","name":"points","id":"id_5b9a625c_bea0_4e2d_8b9c_877511689d66","prompt":null},{"newline":true,"@type":"Output","id":"id_f5acb4dc_7350_4401_baea_c1d663aa1d97","value":"points"},{"condition":"points > 20","@type":"While","id":"id_9cfb5212_7470_4d70_ae0c_b5fb66b0b087","body":{"statements":[{"newline":true,"@type":"Output","id":"id_5ad30e14_7c1b_4b76_a330_7c7113a174fb","value":"\"No! Choose a number below 20!\""},{"@type":"Input","name":"points","id":"id_14b53345_269a_447d_baff_5b543da472f2","prompt":null},{"newline":true,"@type":"Output","id":"id_9e3d3bc0_1877_4a15_ae8c_8f75144e1b36","value":"points"}],"id":"id_41c0bebf_f213_4fc7_826a_75cf832943a6"}},{"@type":"Assign","name":"attempts","id":"id_0002a993_a7bd_4801_80da_04a269a085c0","value":"attempts + 1"},{"@type":"Assign","name":"total","id":"id_50e55822_83bd_4ff3_93b0_46cfe7c75a1d","value":"total - points"},{"falseBlock":{"statements":[{"newline":true,"@type":"Output","id":"id_f0b914d5_06b4_416a_ab58_634f4c5670e6","value":"\"You are on \" + total + \" points.\""}],"id":"id_d3e85ff7_1dbc_4f5a_b556_3b2bf73f58de"},"trueBlock":{"statements":[{"falseBlock":{"statements":[{"newline":true,"@type":"Output","id":"id_b764253a_ca59_4d12_b921_26115d2cadf4","value":"\"You are on \" + total + \" points. Nearly there!\""}],"id":"id_c6477eff_fe78_4e08_a68b_11f1a677395d"},"trueBlock":{"statements":[],"id":"id_add0ad5b_c902_4d4d_acf2_d4a2c893b9c6"},"condition":"total < 0","@type":"If","id":"id_b4307805_734e_49ec_988e_02c9376b8a31"}],"id":"id_222ff779_bd74_4559_96b2_a6603d18eef8"},"condition":"total < 40","@type":"If","id":"id_2a95fd11_95f8_4473_8fca_ba399d890315"}],"id":"id_16e85eb4_76e3_4a54_9fe9_b36e5beb9fa8"}},{"newline":true,"@type":"Output","id":"id_ffc6e8e1_24f8_41d4_869a_f4b33bd26fd7","value":"\"You have reached 0. Well Done! It took you \" + attempts + \" darts.\""},{"@type":"Return","id":"id_8fbad6d3_2306_478e_80e3_ffe367ace175","maybeValue":null}],"parameters":[]},"id":"id_2ad183c0_6a4b_48b2_b19a_0f387d7c0d66","config":{"showDebugVars":true,"useInputPrompt":false,"echoEnteredValue":false,"showIoBtns":true,"showFunctions":false,"lang":"java","showGenCode":false},"version":"0.3","revision":959}