loading

This Plugin Crashed!

Error: Error: must not create an existing file {"type":"CREATE_FILE","wid":"0.12474900409134326","path":"main.rb","file":{"path":"main.rb","content":{"asEncoding":{"base64":"IyAgY2xhc3MucmIKIwojICBDb3B5cmlnaHQgMjAxOCBQYXVsIFN1dHRvbiA8emxlYXBAemxlYXAubmV0PgojCiMgIFRoaXMgcHJvZ3JhbSBpcyBmcmVlIHNvZnR3YXJlOyB5b3UgY2FuIHJlZGlzdHJpYnV0ZSBpdCBhbmQvb3IgbW9kaWZ5CiMgIGl0IHVuZGVyIHRoZSB0ZXJtcyBvZiB0aGUgR05VIEdlbmVyYWwgUHVibGljIExpY2Vuc2UgYXMgcHVibGlzaGVkIGJ5CiMgIHRoZSBGcmVlIFNvZnR3YXJlIEZvdW5kYXRpb247IGVpdGhlciB2ZXJzaW9uIDIgb2YgdGhlIExpY2Vuc2UsIG9yCiMgIChhdCB5b3VyIG9wdGlvbikgYW55IGxhdGVyIHZlcnNpb24uCiMKIyAgVGhpcyBwcm9ncmFtIGlzIGRpc3RyaWJ1dGVkIGluIHRoZSBob3BlIHRoYXQgaXQgd2lsbCBiZSB1c2VmdWwsCiMgIGJ1dCBXSVRIT1VUIEFOWSBXQVJSQU5UWTsgd2l0aG91dCBldmVuIHRoZSBpbXBsaWVkIHdhcnJhbnR5IG9mCiMgIE1FUkNIQU5UQUJJTElUWSBvciBGSVRORVNTIEZPUiBBIFBBUlRJQ1VMQVIgUFVSUE9TRS4gIFNlZSB0aGUKIyAgR05VIEdlbmVyYWwgUHVibGljIExpY2Vuc2UgZm9yIG1vcmUgZGV0YWlscy4KIwojICBZb3Ugc2hvdWxkIGhhdmUgcmVjZWl2ZWQgYSBjb3B5IG9mIHRoZSBHTlUgR2VuZXJhbCBQdWJsaWMgTGljZW5zZQojICBhbG9uZyB3aXRoIHRoaXMgcHJvZ3JhbTsgaWYgbm90LCB3cml0ZSB0byB0aGUgRnJlZSBTb2Z0d2FyZQojICBGb3VuZGF0aW9uLCBJbmMuLCA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50cm8KCnB1dHMgJ1lvdSBhcmUgc3RhbmRpbmcgbmVhciBhIGxhcmdlIG9wZW4gY2F2ZSBlbnRyYW5jZSwgICcKcHV0cyAnaW5zdHJ1Y3Rpb25zIDogJwppbnB1dCA9IGdldHMuY2hvbXAKbmlucHV0ID0gaW5wdXQudXBjYXNlCmlmIG5pbnB1dC5pbmNsdWRlPyAnRk9SV0FSRCcKICBwdXRzICdnb2luZyBmb3J3YXJkJwogIGNhdmUxCmVsc2lmCnB1dHMgIlNvcnJ5IEkgZG9uJ3QgdW5kZXJzdGFuZCIKCmVuZAo="},"asBuffer":null},"loaded":true}}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
#  class.rb
#
#  Copyright 2018 Paul Sutton <zleap@zleap.net>
#
#  This program is free software; you can redistribute it and/or modify
#  it under the terms of the GNU General Public License as published by
#  the Free Software Foundation; either version 2 of the License, or
#  (at your option) any later version.
#
#  This program is distributed in the hope that it will be useful,
#  but WITHOUT ANY WARRANTY; without even the implied warranty of
#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
#  GNU General Public License for more details.
#
#  You should have received a copy of the GNU General Public License
#  along with this program; if not, write to the Free Software
#  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
#  MA 02110-1301, USA.
#
#

# setup

# set up game parameters

inventory = []
health = 10

def printinvent
  print inventory
end

# set up game intro,  we have made the variable name global with $name
def intro
  print 'What is your name? '
  $name = gets.chomp
  puts "Welcome to Cave of time, #{$name.capitalize}"
  puts "Your mission is to explore the cave and learn its secrets.  Your health is #{$health} %"
  puts 'The game understands simple instructions such as FORWARD, BACK,  EXAMINE, TAKE, DROP, FIGHT the game is case insensitive and will covert input to uppercase'
  $name
end

def cave1
  puts 'You enter the cave, and notice the walls are wet,   pools of water are scattered around. Options : FORWARD, BACK,  EXAMINE, TAKE, DROP, FIGHT '
end

intro

puts 'You are standing near a large open cave entrance,  '
puts 'instructions : '
input = gets.chomp
ninput = input.upcase
if ninput.include? 'FORWARD'
  puts 'going forward'
  cave1
elsif
puts "Sorry I don't understand"

end
ruby 2.5.5p157 (2019-03-15 revision 67260) [x86_64-linux]