Advertisement
SuperMonkey

haxe is perfect... almost perfect... :(

Jun 6th, 2014
265
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Haxe 0.46 KB | None | 0 0
  1. class Scanf {
  2.     public var stream:Array<String>;
  3.     public function read() {
  4.         if(stream.length == 0) {
  5.             var str = Sys.stdin().readUntil(10);
  6.             for(i in 0...str.length) {
  7.                 stream.push(str.charAt(i));
  8.             }
  9.         }
  10.         return stream.shift();
  11.     }
  12.     public function new() {
  13.         stream = new Array();
  14.     }
  15. }
  16.  
  17. class Main {
  18.  
  19.     public function new() {
  20.         var a = new Scanf();
  21.         trace(a.read(),a.read(),a.read());
  22.     }
  23.  
  24.     static public function main() {
  25.         new Main();
  26.     }
  27. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement