Guest User

Untitled

a guest
Jul 6th, 2015
284
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. function get_name()
  2.     return "C/++ HEADER CONVERTER"
  3. end
  4.  
  5. function get_description()
  6.     return { "READ C HEADER NAME FROM IN.C", "WRITE C++ HEADER NAME TO OUT.CPP" }
  7. end
  8.    
  9. function get_streams()
  10.     -- The first run of the program always has the same seed for the RNG. The second run decides a seed randomly.
  11.     -- Instead of having a fixed input and a random input, I want two fixed inputs.
  12.     -- I tested it out and discovered that with the fixed seed, the first result of math.random(1, 999) is 428.
  13.     -- (This should be true across computers but I've never tested it, you may have to play around with this)
  14.     -- So if the first random number is 428, I know we're on the fixed seed and I give that input.
  15.     -- Otherwise we must be on the random seed and I give my other input.
  16.    
  17.     if math.random(1, 999) == 428 then
  18.         input = {97, 115, 115, 101, 114, 116, 46, 104, 99, 116, 121, 112, 101, 46, 104, 101, 114, 114, 110, 111, 46, 104, 102, 108, 111, 97, 116, 46, 104, 108, 105, 109, 105, 116, 115, 46, 104}
  19.         output = {99, 97, 115, 115, 101, 114, 116, 99, 99, 116, 121, 112, 101, 99, 101, 114, 114, 110, 111, 99, 102, 108, 111, 97, 116, 99, 108, 105, 109, 105, 116, 115}
  20.     else
  21.         input = {108, 111, 99, 97, 108, 101, 46, 104, 109, 97, 116, 104, 46, 104, 115, 101, 116, 106, 109, 112, 46, 104, 115, 105, 103, 110, 97, 108, 46, 104, 115, 116, 100, 97, 114, 103, 46, 104}
  22.         output = {99, 108, 111, 99, 97, 108, 101, 99, 109, 97, 116, 104, 99, 115, 101, 116, 106, 109, 112, 99, 115, 105, 103, 110, 97, 108, 99, 115, 116, 100, 97, 114, 103}
  23.     end
  24.    
  25.     return {
  26.         { STREAM_INPUT, "IN.C", 0, input },
  27.         { STREAM_OUTPUT, "OUT.CPP", 0, output },
  28.     }
  29. end
  30.  
  31. function get_layout()
  32.     return {
  33.         TILE_COMPUTE,   TILE_COMPUTE,   TILE_COMPUTE,   TILE_COMPUTE,
  34.         TILE_COMPUTE,   TILE_COMPUTE,   TILE_COMPUTE,   TILE_COMPUTE,
  35.         TILE_COMPUTE,   TILE_COMPUTE,   TILE_COMPUTE,   TILE_COMPUTE,
  36.     }
  37. end
RAW Paste Data

Adblocker detected! Please consider disabling it...

We've detected AdBlock Plus or some other adblocking software preventing Pastebin.com from fully loading.

We don't have any obnoxious sound, or popup ads, we actively block these annoying types of ads!

Please add Pastebin.com to your ad blocker whitelist or disable your adblocking software.

×