From Aqua Macaque, 2 Months ago, written in Plain Text.
Embed
  1. string updateData(string data, LRules &R) {
  2.     string buf = "";
  3.         for(unsigned int i = 0; i < data.length(); i++) {
  4.         if ((rand() / RAND_MAX) <= R.prob[data[i]])
  5.             buf += R.m[data[i]];
  6.     }
  7.         return buf;
  8. }