(t = [  // the text that appears on screen. content //
    "credit card0piece of plastic from a bank0piece of plastic that means money in the bank0piece of plastic that means money for the bank0flyers tell me how they sponsor a weapons manufacturer",
    "cash0money from this tech job0(at my desk, I learn all that infrastructure can do)0money will simply pass through my hands0money, God willing, will arrive in theirs",
    "shopping bag0things to buy0for my big little life0some shampoo from conglomerates that finance a genocidal state0things to buy, & I stand paralysed in pharmacy aisles",
    "water bottle0water and bread0a sick sack of flour0water & my favourite kind of bread0a belly of food that takes me back home",
    "transit card0for the stupid metro0to get to class, work, my friends0to get over the river0imagine the desert",
    "sweater0sweater for the cold0sweater as I hurry through temporary elements0sweater, touched by hands that knit & spun & sheared0in this fistful I feel my mother",
    "passport0I’m old enough to get in the bar0passport, a formality0as a testament of where I’m from0so a permission slip to go anywhere",
    "lip balm0lip balm for comfort0lip balm in the brittle winter0lip balm, this tiny luxury0lip balm, & the words “to younus, i will kiss you in heaven”",
    "keys0to get home0a home, can you imagine0a life0I keep digging for a life that belongs to us all",
  ].map((e) => e.split(0))), // each line is broken apart where there are 0's. e is used for the segmented parts of t //
    (n = 5), // 5 is the amount of breaks per line/item //
    (o = []); // empty array //
  for (u = 0; u < n; u++) {
    e = []; // empty array (e is used for the segmented parts of t) //
    for (a = 0; a < t.length; a++) e.push(a); 
    (e = e
      .map((x) => ({ v: x, s: Math.random() })) // randomize generated line? //
      .sort((a, b) => a.s - b.s)
      .map((x) => x.v)),
      o.push(e);
  }
  z = o[n - 1].findIndex((e) => e == t.length - 1);
  o[n - 1].splice(z, 1), o[n - 1].push(t.length - 1);
  (d = document),
    (b = d[(q = "querySelector")]("#b")), // selects b div //
    (l = d[q]("#l")), // button is l div //
    (r = h = 0);
  l.onclick = () => { // when button is pressed ... //
    if (r) {
      (e = o[r][h]), (a = b.querySelectorAll("p")[e]), (i = t[e][r]);
      (a.innerHTML += `—<'i>${i}<'/i>`),
        h++,
        h == t.length && (r++, (h = 0), r == o.length && l.remove());
    } else
      (b.innerHTML += `<'p><'/i>${t[h][r]}<'/i><'/p>`),
        h++,
        h == t.length && (r++, (h = 0));
  };

what's in my bag

my code breakdown is written in pink

i had trouble with keeping track of the variables. they are named pretty vaguely and i lost track of their purposes frequently. i did have to guess with some of them. i hope that i will have a better understanding of this code after the class meeting!

back