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
53 Started my first college CSCI class today. It was a joke today, as it assumes no prior knowledge
55 can't be much worse than solving things like
Code:
{x:=10}[x:=5]
or, of course
Code:
{x:={a1:=10,a2:=5},y:=6}[x][a1:=5][a1]
 

duckfan77

Popular Member
Mar 18, 2013
80
683
118
54 Well, given I don't recognize the system being used, what you posted would be way worse than what today was. The homework consisted of "edit some files and put a comment that they tell you at the top"
 

lenscas

Over-Achiever
Jul 31, 2013
2,015
1,801
248
54 Well, given I don't recognize the system being used, what you posted would be way worse than what today was. The homework consisted of "edit some files and put a comment that they tell you at the top"
55 that system is something they made up. The stuff between the curlybrackets is meant to represent the memory. The stuff between the square brackets are meant to represent instructions. Thus
Code:
{x:=10}
means you have some memory block withing it something called x which has the value 10. and
Code:
[x]
is the instruction to get the value of of, meaning that if we combine them to
Code:
{x:=10}[x]
we get as answer the value 10.
Of course, we can also make this a bit more "complicated" by putting memory in memory and chaining instructions like
Code:
{x:={a1:=10,a2:=5},y:=6}[x][a1:=5][a1]
which means that we have a memory block containing the names x and y.
y contains the simple value 6 and x contains a new memory block. (where a1 has the value 10 and a2 has the value 5)
The instructions are
get the value of X (results in -> {a1:=10,a2:=5})
set a1 to 5 (results in {a1:=5, a2:=5})
return the value of a1 (results in -> 5)
 

GamerwithnoGame

Over-Achiever
Jan 29, 2015
2,808
1,507
224
56. Because Lens was a number too high.

And you've just walked into a pub in Wales, where everyone stops and stares at you.