about summary refs log tree commit diff stats
path: root/089scenario_filesystem.cc
diff options
context:
space:
mode:
authorKartik K. Agaram <vc@akkartik.com>2016-11-11 22:43:43 -0800
committerKartik K. Agaram <vc@akkartik.com>2016-11-11 23:04:01 -0800
commitaa3d29a5666afecd6bce1821ff72ccc5600b431f (patch)
tree14964a3a27004d850f5357cc365623208bb095e6 /089scenario_filesystem.cc
parent6d007fda037331e7761d2a9ed3a2e435131daf7e (diff)
downloadmu-aa3d29a5666afecd6bce1821ff72ccc5600b431f.tar.gz
3668 - $read a word, stopping at whitespace
Useful for programming contests like https://halite.io

Doesn't suffer from C++'s usual buffered gotchas: it'll skip leading
whitespace. Slow, though. Can be speeded up, though.

- 20 minutes later
But what's the point? Typewriter mode is actually harder to test than
'raw' console mode. Writing Mu programs in typewriter mode is just going
to encourage us all to slack off on writing tests.
Diffstat (limited to '089scenario_filesystem.cc')
-rw-r--r--089scenario_filesystem.cc8
1 files changed, 0 insertions, 8 deletions
diff --git a/089scenario_filesystem.cc b/089scenario_filesystem.cc
index ba126cfe..1e64baec 100644
--- a/089scenario_filesystem.cc
+++ b/089scenario_filesystem.cc
@@ -244,11 +244,3 @@ int size_of_resources() {
   delete type;
   return result;
 }
-
-void skip_whitespace(istream& in) {
-  while (true) {
-    if (!has_data(in)) break;
-    if (isspace(in.peek())) in.get();
-    else break;
-  }
-}