diff --git a/Gemfile b/Gemfile
index 59df67b..a923525 100644
--- a/Gemfile
+++ b/Gemfile
@@ -1,6 +1,6 @@
source 'http://rubygems.org'
-ruby '2.6.6'
+# ruby '2.6.5'
gem 'rake'
diff --git a/Gemfile.lock b/Gemfile.lock
index 4dd4a62..0d6fcce 100644
--- a/Gemfile.lock
+++ b/Gemfile.lock
@@ -23,8 +23,5 @@ DEPENDENCIES
minitest-skip
rake
-RUBY VERSION
- ruby 2.6.5p114
-
BUNDLED WITH
2.1.4
diff --git a/lib/.idea/.gitignore b/lib/.idea/.gitignore
new file mode 100644
index 0000000..8bf4d45
--- /dev/null
+++ b/lib/.idea/.gitignore
@@ -0,0 +1,6 @@
+# Default ignored files
+/shelf/
+/workspace.xml
+# Datasource local storage ignored files
+/dataSources/
+/dataSources.local.xml
diff --git a/lib/.idea/inspectionProfiles/Project_Default.xml b/lib/.idea/inspectionProfiles/Project_Default.xml
new file mode 100644
index 0000000..b0db9b0
--- /dev/null
+++ b/lib/.idea/inspectionProfiles/Project_Default.xml
@@ -0,0 +1,6 @@
+
+
+
+
+
+
\ No newline at end of file
diff --git a/lib/.idea/lib.iml b/lib/.idea/lib.iml
new file mode 100644
index 0000000..6e7c09c
--- /dev/null
+++ b/lib/.idea/lib.iml
@@ -0,0 +1,15 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/lib/.idea/misc.xml b/lib/.idea/misc.xml
new file mode 100644
index 0000000..15ffe97
--- /dev/null
+++ b/lib/.idea/misc.xml
@@ -0,0 +1,4 @@
+
+
+
+
\ No newline at end of file
diff --git a/lib/.idea/modules.xml b/lib/.idea/modules.xml
new file mode 100644
index 0000000..b0c4ff6
--- /dev/null
+++ b/lib/.idea/modules.xml
@@ -0,0 +1,8 @@
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/lib/.idea/vcs.xml b/lib/.idea/vcs.xml
new file mode 100644
index 0000000..6c0b863
--- /dev/null
+++ b/lib/.idea/vcs.xml
@@ -0,0 +1,6 @@
+
+
+
+
+
+
\ No newline at end of file
diff --git a/lib/binary_to_decimal.rb b/lib/binary_to_decimal.rb
index 439e8c6..5dd5a72 100644
--- a/lib/binary_to_decimal.rb
+++ b/lib/binary_to_decimal.rb
@@ -4,6 +4,20 @@
# The least significant bit is at index 7.
# Calculate and return the decimal value for this binary number using
# the algorithm you devised in class.
+
def binary_to_decimal(binary_array)
+ sum_of_digits = 0
+ power_of_digit = 7
+ binary_array.each do |digit|
+ sum_of_digits += digit * (2**power_of_digit)
+ power_of_digit -= 1
+ end
+ return sum_of_digits
raise NotImplementedError
end
+
+puts binary_to_decimal([0, 0, 0, 0, 0, 0, 0, 0])
+puts binary_to_decimal([0, 0, 0, 0, 0, 0, 0, 1])
+puts binary_to_decimal([1, 0, 0, 0, 0, 0, 0, 1])
+puts binary_to_decimal([0, 0, 0, 0, 0, 0, 1, 1])
+