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 I managed to get snowscipts somewhat working
Code:
white_walkers=10
feeling_lucky=false
if white_walkers.numbers < 500
  echo "easy"
elif feeling_lucky
  echo "lets improvise"
else
  echo "shit!"
Code:
<?php
global $Anonymous__white_walkers, $Anonymous__feeling_lucky;
$Anonymous__white_walkers = 10;
$Anonymous__feeling_lucky = false;
if (\snow_lt($Anonymous__white_walkers->numbers, 500)) {
  echo "easy";
} elseif ($Anonymous__feeling_lucky) {
  echo "lets improvise";
} else {
  echo "shit!";
}
I did not yet test the php code though
 

lenscas

Over-Achiever
Jul 31, 2013
2,015
1,801
248
72 for those wondering: the php code it generates won't work at all.
First off, all the variables it makes are global for some weird reason,
second, it puts a \ in front of its special function
third, unless I screwed something up $Anonymous__white_walkers->numbers is not a correct way to get the value of $Anonymous__white_walkers
fourth, I can't find the .php file that I need to include to get functions like snow_lt() working

so....yea....not even going to try and fix all those errors :p
 

lenscas

Over-Achiever
Jul 31, 2013
2,015
1,801
248
78 I now am at the point where my code really needs to start reading the cards and where I need to implement the turn logic.

I already stupidly removed one phase because of derpy mind.
This is going to be great >_<
 

lenscas

Over-Achiever
Jul 31, 2013
2,015
1,801
248
81 Considering my plan is to get it live one day, you probably get to see it one day :)

However, many things are not yet to my liking. The fact that it has turned into a school project (and thus I suddenly have pressure to work on it) has caused me to make some decisions that I rather not have made. Which on one hand is great as I have now learned that pressure to get something done effects my coding behavior, I would however have liked it if I found that out with another project though.

On the other hand, stuff is actually getting done right now instead of ending up in an dark abyss(?) of dead and decayed projects that I once started but lost interest in.

There are also some things that need to change in the future as I just lack the knowledge of those things right now. (one of which is that it is apparently possible for a browser to send stuff to another browser, which would help greatly in the turn logic as right now it just asks the server every second if a new turn has started.)

oh, btw the "bad" decisions I did shouldn't effect performance (well, except for the ping every second thing) but are mostly about not using the correct models or not being consistent with how I write queries. I used:

1, $result=$this->db->get_where()->row_array();

2, $this->db->select();
$this->db->from();
$this->db->where();
$query=$this->db->get();
$result=$query->row_array();

3, $result= $this->db->select()
->from()
->where()
->get()
->row_array();

Guess with which one I started and which ones I use now :p
 

lenscas

Over-Achiever
Jul 31, 2013
2,015
1,801
248
84 I started with 2, due to time I started to use 1 but want to change it to 3
Reason: 1 is very limited thus I would end up with using either 3 or 1 as well, which would still give me inconsistent query building.