Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function get_name()
- return "C/++ HEADER CONVERTER"
- end
- function get_description()
- return { "READ C HEADER NAME FROM IN.C", "WRITE C++ HEADER NAME TO OUT.CPP" }
- end
- function get_streams()
- -- The first run of the program always has the same seed for the RNG. The second run decides a seed randomly.
- -- Instead of having a fixed input and a random input, I want two fixed inputs.
- -- I tested it out and discovered that with the fixed seed, the first result of math.random(1, 999) is 428.
- -- (This should be true across computers but I've never tested it, you may have to play around with this)
- -- So if the first random number is 428, I know we're on the fixed seed and I give that input.
- -- Otherwise we must be on the random seed and I give my other input.
- if math.random(1, 999) == 428 then
- 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}
- 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}
- else
- 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}
- 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}
- end
- return {
- { STREAM_INPUT, "IN.C", 0, input },
- { STREAM_OUTPUT, "OUT.CPP", 0, output },
- }
- end
- function get_layout()
- return {
- TILE_COMPUTE, TILE_COMPUTE, TILE_COMPUTE, TILE_COMPUTE,
- TILE_COMPUTE, TILE_COMPUTE, TILE_COMPUTE, TILE_COMPUTE,
- TILE_COMPUTE, TILE_COMPUTE, TILE_COMPUTE, TILE_COMPUTE,
- }
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement