start
num firstOperand
num secondOperand
num myAnswer
input firstOperand
input secondOperand
call multiplyBot()
myAnswer = firstOperand * secondOperand
display myAnswer
end
Is this how modules work? It's just pseudo code, so I know there's no "right" way to do it, but is this logic functional? Does it make sense?
Task is to create a module that has two input parameters.
Not entirely sure if thisd be called a module, module is usually synonymous with library.
A function/method would be a better name. And youd want to define all your variables inside the function, and either get your input inside or pass it as an argument.
Youre also only defining a function and not actually calling it. Also, if that were Python, you wouldnt be able to access those variables since theyre defined outside the function.
E: You're doing something weird. Youre calling a function but then defining it there, which defeats the point of a function, which is to standardize code so you only have to change it in one place rather than in fifty different places.
I dont really like dynamic typing because I do most of my coding for tgstation, and replacing or renaming a variable, especially for base types or types with lots of children means you have to adjust it elsewhere. With dynamic typing, you'd have ro manually find said variable everywhere, but with static typing, the compiler tells you where you need to correct things.