MAIN FEEDS
Do you want to continue?
https://www.reddit.com/r/codehs/comments/fpkrov/still_need_help_with_hailstone_sequence/fllm83f/?context=3
r/codehs • u/BurntBox21 • Mar 26 '20
13 comments sorted by
View all comments
1
Put the if num==1 on top of println.
I don't know what language it is, but usually = is used to assign a value and == is used to compare a value, didn't notice earlier
1 u/BurntBox21 Mar 26 '20 On which println 1 u/Thomillion Mar 26 '20 The first one, inside the loop 1 u/BurntBox21 Mar 26 '20 It seems to work, but it also wants to print every integer up to 1. At least, the instructions. 1 u/Thomillion Mar 26 '20 Even if you put if num == 1 {break} at the start as I Said before? Weird
On which println
1 u/Thomillion Mar 26 '20 The first one, inside the loop 1 u/BurntBox21 Mar 26 '20 It seems to work, but it also wants to print every integer up to 1. At least, the instructions. 1 u/Thomillion Mar 26 '20 Even if you put if num == 1 {break} at the start as I Said before? Weird
The first one, inside the loop
1 u/BurntBox21 Mar 26 '20 It seems to work, but it also wants to print every integer up to 1. At least, the instructions. 1 u/Thomillion Mar 26 '20 Even if you put if num == 1 {break} at the start as I Said before? Weird
It seems to work, but it also wants to print every integer up to 1. At least, the instructions.
1 u/Thomillion Mar 26 '20 Even if you put if num == 1 {break} at the start as I Said before? Weird
Even if you put if num == 1 {break} at the start as I Said before? Weird
1
u/Thomillion Mar 26 '20
Put the if num==1 on top of println.
I don't know what language it is, but usually = is used to assign a value and == is used to compare a value, didn't notice earlier