Good vs. Evil

  • The FTB Forum is now read-only, and is here as an archive. To participate in our community discussions, please join our Discord! https://ftb.team/discord

lenscas

Over-Achiever
Jul 31, 2013
2,015
1,801
248
70 already got a working prototype of the internal structure. (yes, that includes something that runs it)
Well, before I broke it by adding a counter command, though that may just be the structure I use.
It has support for "datalines". This is implemented by each command being able to make references to other code blocks.
It has an jump. This is how loops and if's work internally, user won't have to worry about those.
It has an if. If an expression is true->continue, else jump. And thanks to the jump this can also be used for while loops.

I'm currently working on a block that works as a counter, this will make for loops possible.
 

lenscas

Over-Achiever
Jul 31, 2013
2,015
1,801
248
72 so....I have a small problem though
upload_2017-10-9_18-59-41.png
In the current implementation code blocks never reset their values unless they are executed.
Code blocks also grab the first value they find. Meaning that the print block first checks if the True path has a value before it checks the false path.

Now comes the problem. If the true path gets executed it will get a value. Then, after the false pad gets executed said value remains. As a result, the print will still print the True path rather then the false path.
 

triggerfinger12

Well-Known Member
Apr 17, 2017
255
457
89
Rock
73 Does it have to keep it's value until it is executed again? Can you do a thing that it resets itself if the false path has to be prioritized or something like that?
 

lenscas

Over-Achiever
Jul 31, 2013
2,015
1,801
248
73 Does it have to keep it's value until it is executed again? Can you do a thing that it resets itself if the false path has to be prioritized or something like that?
74 if's are done using jumps. So... I am just going to make jumps slow and reset everything in their path.
That way, the false path always clears the true path and when writing a loop everything inside the loop gets cleared before the loop runs. This,will make jumps a lot slower though but I don't think that will be much of a problem

edit : decided to only make forward jumps resetting. The true part needs to jump over the false part and the false part needs to jump over the true part, thus those will get reset.

Because going back doesn't reset loops will stay fast (as those only jump backwards). I may decide to ask a teacher for a better idea though, considering that we get programming using a fictional language I would guess they enjoy this kind of thing.
 
Last edited:

duckfan77

Popular Member
Mar 18, 2013
80
683
118
75 I've just been told that there will be classes where we will write code but not use any IDE... Why.
 

lenscas

Over-Achiever
Jul 31, 2013
2,015
1,801
248
75 I've just been told that there will be classes where we will write code but not use any IDE... Why.
76 so far all programming lessons I had on this school where done with pen and paper. Well... except for the exercises, which where done using a program that no one has an idea on how to use.

Seriously, so far the only questions I asked where what this program wanted me to do and the one time I decided to ask a teacher for help with that I ended up with 2 teachers explaining it because the first didn't get it either >_>

(I already know how to program so it may not truly reflect how difficult it is compared to the questions)
Also, the exercises are just mean. There is one where you need to fill in a while loop and in order to "help" you you have a nice table with each variable and their state at each step.
the loop is something like
Code:
a = 5.5
while a>0 do
    a = a-0.1
end
The table we had was
a = 5.5
a = 5.4
a = 5.30000000001
etc,etc,etc

For me its fine to fill in the a = a -0.1 part because I already knew that computers are bad at floats. But so far it was only said once that computers do stupid stuff like that and that was more in an off comment somewhere during one of the lessons. So... good luck if its your first year programming and didn't remember or caught that comment. (you could only set the initial value of a, write when the loop needs to stop and what to subtract each time. So, no way you can do something "smart" with if statements to get the same effect)
 

triggerfinger12

Well-Known Member
Apr 17, 2017
255
457
89
Rock
77 I saw the loop before you even mentioned how the table turned out... Does that mean I'm smart, or that I just am not lacking in the common sense department?
 

lenscas

Over-Achiever
Jul 31, 2013
2,015
1,801
248
77 I saw the loop before you even mentioned how the table turned out... Does that mean I'm smart, or that I just am not lacking in the common sense department?
78 I think you didn't understood the point.
I already filled the loop in, the thing I was complaining about was the fact that the numbers that are supposed to help you wend from
5.5 to 5.4 to 5.3000000001
 

duckfan77

Popular Member
Mar 18, 2013
80
683
118
79 So they just copied the output of running the loop from the shell or whatever, and then just said, have at it, figure this out. Nice. Either clean it up, or make it clear the computer make floating point errors.
 

lenscas

Over-Achiever
Jul 31, 2013
2,015
1,801
248
80 I guess (and that is all I can do) is that they wanted it to look odd and get people to trip over it so that that lesson is quickly learned in an environment where ideally a teacher is quickly able to explain it if the student isn't able to figure it out on their own.

Better to get students used to it quickly and in an environment where no harm is done rather then later and in an environment where either a (group) project is at stake or perhaps even worse if said student manages to somehow avoid float problems during the whole time they are at school. (you don't want someone walking around looking for a job who thinks floats are a good idea to use when money is involved right?)
 

duckfan77

Popular Member
Mar 18, 2013
80
683
118
81 Just the thought of that... floats with money. If all you care about is cents, work with ints of units cents.
 

duckfan77

Popular Member
Mar 18, 2013
80
683
118
82 Point, if you don't know about floating point errors, why not use floats for money, they can record any precision we need.
 

lenscas

Over-Achiever
Jul 31, 2013
2,015
1,801
248
84 so... this is one if the programs I now need to complete.
upload_2017-10-10_22-45-46.png

This is completely readable and something someone would really write /s

edit : decided to work on other programs first.And... found out that this site likes to screw with tabs when you click the button to show to which line the current "memory dump" belongs to.

Considering these "programs" are done using python where indents show which lines belong to which block of code (thus, if its inside or outside a loop for example) THAT IS A VERY BIG DEAL!
 
Last edited:

lenscas

Over-Achiever
Jul 31, 2013
2,015
1,801
248
85 I tried to read it, but I gave up because I didn't have a pen and paper to keep track :/
well... I also have to scroll up and down to see the memory dumps (which you will need to finish it). Also, read the edit for even more reasons I hate that site.

And then I didn't mention the fact that checking an answer takes ages, the site itself is very laggy (on my laptop I could easily type one or more sentences before the first characters will show up) and there are at least 2 or 3 scrollbars missing.
upload_2017-10-10_23-20-18.png
I mean, look at that and tell me how many pieces there are that can scroll individual (thus without scrolling the whole page). Also, tell me what part of the page the scroll bar belongs to.
Also, when you write something in those input fields and press enter what you typed becomes plain text and a new input field appears next to it. If you want the page to actually check your answer you will need to make all input fields go away which you do by pressing enter when nothing is written inside them.

I rather have this layout http://www.phyrexia.com/forum/ and that is from a site long abandoned from an era where they though that putting gif's everywhere was a good idea. I mean, it may not look the best but at least it loads reasonably fast and you can navigate the page.

Is there something I can say about this site that is good? If there is, I don't know what. Its that bad.Pretty much all my mistakes are in one way or another related to this site just being absolute trash.

edit: found another thing that is broken: when its checking the answer they put a "nice" big rotating + sign on the page. I expect this to be in the middle, but instead its in the upper left corner.
edit 2 : I found out why the site is laggy. They didn't manage to deploy it correctly and are still using the dev-version of react (and just minified it). So.... hooray for console.log() spam and some other warnings.
 
Last edited:

duckfan77

Popular Member
Mar 18, 2013
80
683
118
85 I see at least two areas to scroll, but only one scroll bar... Also, That looks like it was designed by someone who was just learning HTML and has no idea how to design something. I mean that includes me, but it certainly doesn't look good or professional.