+
Not found :(
+
Sorry, but the page you were trying to view does not exist.
+
It looks like this was the result of either:
+
+ - a mistyped address
+ - an out-of-date link
+
+
+
+
+
+
diff --git a/Task1/app/coffee/ConsoleEmulator.coffee b/Task1/app/coffee/ConsoleEmulator.coffee
new file mode 100644
index 0000000..159c2ef
--- /dev/null
+++ b/Task1/app/coffee/ConsoleEmulator.coffee
@@ -0,0 +1,45 @@
+class ConsoleEmulator
+
+ currentPath = '/'
+
+ getCurrentPath: ->
+ currentPath
+
+ changeDirectory = (path) ->
+ currentPath = privateOptimizePath(path) + '/'
+ return
+
+ privateClear = ->
+ currentPath = '/'
+
+ clear: ->
+ privateClear()
+ return
+
+ privateOptimizePath = (path) ->
+ items = path.split '/'
+ loop
+ indexOfDotDot = items.indexOf '..'
+ break if indexOfDotDot is -1
+ items.splice indexOfDotDot, 1
+ items.splice indexOfDotDot - 1, 1 if indexOfDotDot > 1
+ if items.length is 0
+ items.push ''
+ items.join('/')
+
+ optimizePath: (path) ->
+ privateOptimizePath(path)
+
+ load: (items) ->
+ output = []
+ for item in items
+ if item.length is 3 and item is 'pwd'
+ output.push currentPath
+ continue
+ path = item.split(' ')[1]
+ if path[0] isnt '/'
+ path = currentPath + path
+ changeDirectory(path)
+ privateClear()
+ output
+
diff --git a/Task1/app/coffee/main.coffee b/Task1/app/coffee/main.coffee
new file mode 100644
index 0000000..ce844be
--- /dev/null
+++ b/Task1/app/coffee/main.coffee
@@ -0,0 +1,11 @@
+'use strict'
+
+getCommandsFromText = (string) ->
+ string.match(/[^\r\n]+/g) or []
+
+run = ->
+ commands = getCommandsFromText($('#inputData').val())
+ consoleEmulator = new ConsoleEmulator
+ result = consoleEmulator.load(commands)
+ $('#outputData').val(result.join('\n'));
+ return
\ No newline at end of file
diff --git a/Task1/app/coffee/test.coffee b/Task1/app/coffee/test.coffee
new file mode 100644
index 0000000..4242551
--- /dev/null
+++ b/Task1/app/coffee/test.coffee
@@ -0,0 +1 @@
+two = 2
\ No newline at end of file
diff --git a/Task1/app/favicon.ico b/Task1/app/favicon.ico
new file mode 100644
index 0000000..6527905
Binary files /dev/null and b/Task1/app/favicon.ico differ
diff --git a/Task1/app/index.html b/Task1/app/index.html
new file mode 100644
index 0000000..d8b4d99
--- /dev/null
+++ b/Task1/app/index.html
@@ -0,0 +1,87 @@
+
+
+
+