#Issue with generating isosceles

1 messages · Page 1 of 1 (latest)

plain wagon
#

Honestly idk what i am doing wrong, as i said i js started with return values and my brain can't process them well

eternal shellBOT
#

<@&987246399047479336> please have a look, thanks.

plain wagon
#

As the script should do: Ask the question, then i wanna get the result of the question in numbers, then acess the int, make the isosceles based on that number, then return the print

#

i tried also to transform the generator to a void, but still have issues

covert tapir
#

Why question.length()?

#

Also pls pass to camelCase.

BallsCase, or however it's called, is standardised to classes.

plain wagon
covert tapir
#

Smth

#

Use try-catch in case the user inputs unallowed chars

#

And again, not question.length() as parameter

plain wagon
covert tapir
#

You gotta be careful. It's a chain reaction. Change 1 thing, change all references

plain wagon
#

As like i tried rn to run it, and it prints "1"

#

and not the generator

covert tapir
plain wagon
#

OPS

covert tapir
#

Read it all

#

Why have you placed numOfStars outside the for loop? Thats odd.

#

Could've done for(int numOfStars = 0; ...)

#

Ahh you return it after

#

Straight up pass to a while loop. Cleaner.
Also show what you get.

#

The number you pass to the function is a actually the number of rows of your output, if you look carefully.

plain wagon
covert tapir
#

You are returning the number 3 and printing it in main

plain wagon
covert tapir
#

What spaces? Println() correctly places a space AND goes down. BUT at the end of the inner loop. So the soace isn't visible

covert tapir
#

And remove the call from the argument of IO.println

plain wagon
covert tapir
#

Rethink of it for 3 mins.

plain wagon
#

Which wont allow me to print the result

covert tapir
#
  1. void returns no type - IO.println doesn't accept void.
  2. what are you expecting to print? isoscelesGenerator already is printing.
#
  1. No need of a return statement in a void function, unless doing early-return.
plain wagon
#

Wait, il try debug it

#

As i am getting angry fr

#

wait

covert tapir
#

I gave ya all the answers.

plain wagon
#

il keep trying

pure stump
#

How many letters are in the word Apple?

plain wagon
pure stump
#

Good God

#

Try again

pure stump
#

When you call it it will print it doesn't need to return anything necessarily

plain wagon
pure stump
#

Swap lines 10 and 11

mortal maple
#

ur putting new line only at the end

#

after the circus has ended

plain wagon
plain wagon
#

i didn't realize the print was outside of the loop

mortal maple
#

train ur concentration

pure stump
plain wagon
mortal maple
plain wagon
pure stump
mortal maple
#

you forget because you dont know to read code yet. programming is almost learning a foreign language. need the grammar, but also need practice to get the right eye pattern

#

u'll learn

plain wagon
#

Currently fixed the printing and everything, now this return eats me 😭

plain wagon
mortal maple
#

why do u have totalrows

#

if it's just number

plain wagon
#

The number? the rows?

mortal maple
#

why do u want to return

#

make it void

plain wagon
#

In general just the pattern

mortal maple
#

no return pattern

#

you return what you need

plain wagon
mortal maple
#

remove io.println

plain wagon
#

Yeah, so in general i didn't understood the concept of return and forgot how to do isosceles 😭

mortal maple
#

remove the return

#

you are not returning anything

plain wagon
#

Yeah idk why i even used return at this point

#

felt useles in this.

#

useless*