@dixiekorley/

Fabric counter

Ruby

Program that helps you pick the right yards for a style. Still in its infancy.

fork
loading
Files
  • main.rb

This Plugin Crashed!

Error: Error: must not create an existing file {"type":"CREATE_FILE","wid":"0.2220208160320014","path":"main.rb","file":{"path":"main.rb","content":{"asEncoding":{"base64":"cHJpbnQgIkhpISBXZSdyZSB0ZXN0aW5nIG91dCB0aGlzIHNpbXBsZSBlc3RpbWF0b3IgZm9yIHlvdXIgbmV4dCBmYWJyaWMgc2hvcHBpbmcgZXhwZWRpdGlvbiEgRm9yIG5vdywgd2UgZG8gbm90IGhhdmUgbWFueSBvcHRpb25zIGZvciB5b3UgdG8gcGljayBmcm9tLCBidXQgeW91IG1heSBoZWFyIGEgbGl0dGxlIG1vcmUgZnJvbSB1cyBvbmNlIHdlIGZpeCB0aGlzIHVwIGEgYml0LiBJbiB0aGUgbWVhbiB0aW1lLCBsZXQncyBnZXQgc3RhcnRlZCEiICJcbiIKICAgCiAgICBwcmludCAiMS4gU2tpcnQiICJcbiIKICAgIHByaW50ICIyLiBEcmVzcyIgIlxuIgogICAgcHJpbnQgIjMuIEJsb3VzZSIgIlxuIgogICAgCiAgICAiXG4iCiAgICAKICAgIHB1dHMgIkFyZSB5b3UgbWFraW5nIGEgLSBzdHJhaWdodCBza2lydCwgc3RyYWlnaHQgZHJlc3Mgb3IgYSBibG91c2U/IgogICAgCiAgICAiXG4iCiAgICAKICAgIGNob2ljZSA9IGdldHMuc3RyaXAKICAgIAogICAgCiAgICBpZiBjaG9pY2UgPT09ICJzdHJhaWdodCBza2lydCIKICAgICAgCiAgICAgIHB1dHMgIldhaXN0OiAiCiAgICAgICAgd2Fpc3QgPSBnZXRzLnRvX3IKICAgICAgICAKICAgICAgICBwdXRzICJIaXA6ICIKICAgICAgICBoaXAgPSBnZXRzLnRvX3IKICAgICAgICAKICAgICAgICBwdXRzICJTa2lydCBsZW5ndGg6ICIKICAgICAgICBza2lydF9sZW5ndGggPSBnZXRzLnRvX2kKICAgICAgIAogICAgIC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AgICBoaXAgPSBnZXRzLnRvX3IKICAgICAgICAKICAgICAgICBwdXRzICJBcmUgeW91IHdlYXJpbmcgc2xlZXZlcz8gWSBvciBOPyIKICAgICAgICBnZXR0aW5nX2FybSA9IGdldHMuc3RyaXAKICAgICAgICAKICAgICAgICBoaXBfaW5jaGVzID0gaGlwICsgMTAgCiAgICAgICAgeWFyZHMxID0gaGlwX2luY2hlcyAvIDM2LnRvX3IKICAgICAgICAKICAgICAgICB3YWlzdF9pbmNoZXMgPSB3YWlzdCArIDEwCiAgICAgICAgeWFyZHMyID0gd2Fpc3RfaW5jaGVzIC8gMzYudG9fcgogICAgICAgIAogICAgICAgIGJ1c3RfaW5jaGVzID0gYnVzdCArIDEwCiAgICAgICAgeWFyZHMzID0gYnVzdCAvIDM2LnRvX3IKICAgICAgICAKICAgICAgICBkcmVzc19sZW5ndGggPSBoZWlnaHQgKiAwLjg3NQogICAgICAgIAogICAgICAgIHdpZHRoID0gZHJlc3NfbGVuZ3RoCiAgICAgICAgCiAgICAgICAgCiAgICBpZiBnZXR0aW5nX2FybSA9PT0gIlkiCiAgICAgICAgcHV0cyAiV2hhdCBpcyB5b3VyIHNsZWV2ZSBsZW5ndGg/IgogICAgICAgIHNsZWV2ZSA9IGdldHMudG9faQogICAgICAgIHB1dHMgIldoYXQgaXMgeW91ciBhcm0gY2lyY3VtZmVyZW5jZT8iCiAgICAgICAgYV9jaXJjdW1mZXJlbmNlID0gZ2V0cy50b19yIC8gMzYudG9fcgogICAgZW5kICAgCiAgICAgICAgd2l0aF9zbGVldmUxID0geWFyZHMxICsgYV9jaXJjdW1mZXJlbmNlCiAgICAgICAgCiAgICAgICAgd2l0aF9zbGVldmUyID0geWFyZHMyICsgYV9jaXJjdW1mZXJlbmNlCiAgICAgICAgCiAgICAgICAgd2l0aF9zbGVldmUzID0geWFyZHMzICsgYV9jaXJjdW1mZXJlbmNlCiAgICAgICAgCiAgICAgICAgaWYgaGlwID4gYnVzdCAmJiBoaXAgPiB3YWl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N0aW9uIGhpZ2hlciB0aGFuIHlvdXIgb3duLiIKICAgIGVsc2UgcHJpbnQgIllvdSBtYXkgbmVlZCB0byBkb3VibGVjaGVjayBhIGZldyB0aGluZ3MuIgogICAgICAgIGVuZAogICAgCgogICAgZWxzaWYgY2hvaWNlID09PSAiYmxvdXNlIgogICAgICAgIHB1dHMgIkJ1c3Q6ICIKICAgICAgICBidXN0ID0gZ2V0cy50b19yCiAgICAgICAgcHV0cyAiV2Fpc3Q6ICIKICAgICAgICB3YWlzdCA9IGdldHMudG9fcgogICAgICAgIHB1dHMgIkhpcDogIiAKICAgICAgICBoaXAgPSBnZXRzLnRvX3IKICAgICAgICBwdXRzICJCbG91c2UgbGVuZ3RoOiAiCiAgICAgICAgYmxvdXNlX2xlbmd0aCA9IGdldHMudG9faQogICAgICAgIHB1dHMgIkFyZSB5b3Ugd2VhcmluZyBzbGVldmVzPyBZIG9yIE4/IgogICAgICAgIGdldHRpbmdfYXJtID0gZ2V0cy5zdHJpcAogICAgICAgIAogICAgICAgIGhpcF9pbmNoZXMgPSBoaXAgKyAxMCAKICAgICAgICB5YXJkczEgPSBoaXBfaW5jaGVzIC8gMzYudG9fcgogICAgICAgIAogICAgICAgIHlhcmRhZ2UxID0geWFyZHMxIC8gMi50b19yCiAgICAgICAgCiAgICAgICAgd2Fpc3RfaW5jaGVzID0gd2Fpc3QgKyAxMAogICAgICAgIHlhcmRzMiA9IHdhaXN0X2luY2hlcyAvIDM2LnRvX3IKICAgICAgICAKICAgICAgICB5YXJkYWdlMiA9IHlhcmRzMiAvIDIudG9fcgogICAgICAgIAogICAgICAgIGJ1c3RfaW5jaGVzID0gYnVzdCArIDEwCiAgICAgICAgeWFyZHMzID0gYnVzdCAvIDM2LnRvX3IKICAgICAgICAKICAgICAgICB5YXJkYWdlMyA9IHlhcmRzMyAvIDIudG9fcgogICAgICAgIAogICAgICAgIHdpZHRoID0gYmxvdXNlX2xlbmd0aCAqIDIKICAgICAgICAKICAgICAgIAogICAgICA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
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
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
print "Hi! We're testing out this simple estimator for your next fabric shopping expedition! For now, we do not have many options for you to pick from, but you may hear a little more from us once we fix this up a bit. In the mean time, let's get started!" "\n"
   
    print "1. Skirt" "\n"
    print "2. Dress" "\n"
    print "3. Blouse" "\n"
    
    "\n"
    
    puts "Are you making a - straight skirt, straight dress or a blouse?"
    
    "\n"
    
    choice = gets.strip
    
    
    if choice === "straight skirt"
      
      puts "Waist: "
        waist = gets.to_r
        
        puts "Hip: "
        hip = gets.to_r
        
        puts "Skirt length: "
        skirt_length = gets.to_i
       
        hip_inches = hip + 10 
        yards1 = hip_inches / 36.to_r
        
        waist_inches = waist + 10
        yards2 = waist_inches / 36.to_r
        
        width = skirt_length + 5

      if waist_inches > hip_inches
       puts "You need #{yards1.to_i} and #{yards1-yards1.to_i} yard(s) with a #{width} width. 
       NOTE: Fabric width usually ranges between 45 and 60. There are others, but make sure you have enough width. Fractions come in 1/8, 1/4, 3/8, 1/2, 5/8, 3,4, and up to a whole. Get your yard(s) and make sure you pick a fraction higher than your own."
        
    elsif hip_inches > waist_inches
       puts "You need #{yards2.to_i} and #{yards2-yards2.to_i} yard(s) with a #{width} width. NOTE: Fabric width usually ranges between 45 and 60. There are others, but make sure you have enough width. Fractions come in 1/8, 1/4, 3/8, 1/2, 5/8, 3,4, and up to a whole. Get your yard(s) and make sure you pick a fraction higher than your own."
     elsif hip_inches === waist_inches
      puts "You need #{yards2.to_i} and #{yards2-yards2.to_i} yards with a #{width} width. NOTE: Fabric width usually ranges between 45 and 60. There are others, but make sure you have enough width. Fractions come in 1/8, 1/4, 3/8, 1/2, 5/8, 3,4, and up to a whole. Get your yard(s) and make sure you pick a fraction higher than your own."
    else "Invalid input."
     end
    
    elsif choice === "straight dress"
        puts "Type your height in inches (1ft = 12in): " 
        height = gets.to_i
        puts "What's your bust?"
        bust = gets.to_r
        puts "Waist: "
        waist = gets.to_r
        puts "Hip: "
        hip = gets.to_r
        
        puts "Are you wearing sleeves? Y or N?"
        getting_arm = gets.strip
        
        hip_inches = hip + 10 
        yards1 = hip_inches / 36.to_r
        
        waist_inches = waist + 10
        yards2 = waist_inches / 36.to_r
        
        bust_inches = bust + 10
        yards3 = bust / 36.to_r
        
        dress_length = height * 0.875
        
        width = dress_length
        
        
    if getting_arm === "Y"
        puts "What is your sleeve length?"
        sleeve = gets.to_i
        puts "What is your arm circumference?"
        a_circumference = gets.to_r / 36.to_r
    end   
        with_sleeve1 = yards1 + a_circumference
        
        with_sleeve2 = yards2 + a_circumference
        
        with_sleeve3 = yards3 + a_circumference
        
        if hip > bust && hip > waist
        puts "You need #{with_sleeve1.to_i} and #{with_sleeve1-with_sleeve1.to_i} yard(s) with a #{width} width. 
      NOTE: Fabric width usually ranges between 45 and 60. There are others, but make sure you have enough width. Fractions come in 1/8, 1/4, 3/8, 1/2, 5/8, 3,4, and up to a whole. Get your yard(s) and make sure you pick a fraction higher than your own."
      elsif bust > hip && bust > waist
      puts "You need #{with_sleeve2.to_i} and #{with_sleeve2-with_sleeve2.to_i} yard(s) with a #{width} width. 
      NOTE: Fabric width usually ranges between 45 and 60. There are others, but make sure you have enough width. Fractions come in 1/8, 1/4, 3/8, 1/2, 5/8, 3,4, and up to a whole. Get your yard(s) and make sure you pick a fraction higher than your own."
      elsif waist > bust && waist > hip
      puts "You need #{with_sleeve3.to_i} and #{with_sleeve3-with_sleeve3.to_i} yard(s) with a #{width} width. 
      NOTE: Fabric width usually ranges between 45 and 60. There are others, but make sure you have enough width. Fractions come in 1/8, 1/4, 3/8, 1/2, 5/8, 3,4, and up to a whole. Get your yard(s) and make sure you pick a fraction higher than your own."
    else print "Check your measurements."
    end
   
        
    elsif getting_arm === "N"
        if hip > bust && hip > waist
             puts "You need #{yards1.to_i} and #{yards1-yards1.to_i} yard(s) with a #{width} width. NOTE: Fabric width usually ranges between 45 and 60. There are others, but make sure you have enough width. Fractions come in 1/8, 1/4, 3/8, 1/2, 5/8, 3,4, and up to a whole. Get your yard(s) and make sure you pick a fraction higher than your own."
             elsif waist > bust && waist > hip
              puts "You need #{yards2.to_i} and #{yards2-yards2.to_i} yard(s) with a #{width} width. 
      NOTE: Fabric width usually ranges between 45 and 60. There are others, but make sure you have enough width. Fractions come in 1/8, 1/4, 3/8, 1/2, 5/8, 3,4, and up to a whole. Get your yard(s) and make sure you pick a fraction higher than your own."
        elsif bust > hip && bust > waist 
           puts "You need #{yards3.to_i} and #{yards3-yards1.to_i} yard(s) with a #{width} width. 
      NOTE: Fabric width usually ranges between 45 and 60. There are others, but make sure you have enough width. Fractions come in 1/8, 1/4, 3/8, 1/2, 5/8, 3,4, and up to a whole. Get your yard(s) and make sure you pick a fraction higher than your own."
    else print "You may need to doublecheck a few things."
        end
    

    elsif choice === "blouse"
        puts "Bust: "
        bust = gets.to_r
        puts "Waist: "
        waist = gets.to_r
        puts "Hip: " 
        hip = gets.to_r
        puts "Blouse length: "
        blouse_length = gets.to_i
        puts "Are you wearing sleeves? Y or N?"
        getting_arm = gets.strip
        
        hip_inches = hip + 10 
        yards1 = hip_inches / 36.to_r
        
        yardage1 = yards1 / 2.to_r
        
        waist_inches = waist + 10
        yards2 = waist_inches / 36.to_r
        
        yardage2 = yards2 / 2.to_r
        
        bust_inches = bust + 10
        yards3 = bust / 36.to_r
        
        yardage3 = yards3 / 2.to_r
        
        width = blouse_length * 2
        
       
        if getting_arm === "Y" 
       
        puts "What is your sleeve length?"
        sleeve = gets.to_i
        puts "What is your arm circumference?"
        a_circumference = gets.to_r / 36
        end 

        with_sleeve1 = yardage1 + a_circumference
        
        with_sleeve2 = yardage2 + a_circumference
        
        with_sleeve3 = yardage3 + a_circumference
        
          if hip > bust && hip > waist
                 puts "You need #{with_sleeve1.to_i} and #{with_sleeve1-with_sleeve1.to_i} yard(s) with a #{width} width.  NOTE: Fabric width usually ranges between 45 and 60. There are others, but make sure you have enough width. Fractions come in 1/8, 1/4, 3/8, 1/2, 5/8, 3,4, and up to a whole. Get your yard(s) and make sure you pick a fraction higher than your own."
          elsif bust > hip && bust > waist  
                puts "You need #{with_sleeve2.to_i} and #{with_sleeve2-with_sleeve2.to_i} yard(s) with a #{width} width. NOTE: Fabric width usually ranges between 45 and 60. There are others, but make sure you have enough width. Fractions come in 1/8, 1/4, 3/8, 1/2, 5/8, 3,4, and up to a whole. Get your yard(s) and make sure you pick a fraction higher than your own."
          elsif waist > bust && waist > hip 
                 puts "You need #{with_sleeve3.to_i} and #{with_sleeve1-with_sleeve3.to_i} yard(s) with a #{width} width. NOTE: Fabric width usually ranges between 45 and 60. There are others, but make sure you have enough width. Fractions come in 1/8, 1/4, 3/8, 1/2, 5/8, 3,4, and up to a whole. Get your yard(s) and make sure you pick a fraction higher than your own."
          else print "Make sure the measurements are clear."
          end
        elsif getting_arm === "N"
            if hip > bust && hip > waist
                 puts "You need #{yardage1.to_i} and #{yardage1-yardage1.to_i} yard(s) with a #{width} width.  NOTE: Fabric width usually ranges between 45 and 60. There are others, but make sure you have enough width. Fractions come in 1/8, 1/4, 3/8, 1/2, 5/8, 3,4, and up to a whole. Get your yard(s) and make sure you pick a fraction higher than your own."
             elsif bust > hip && bust > waist 
                puts "You need #{yardage2.to_i} and #{yardage2-yardage2.to_i} yard(s) with a #{width} width.  NOTE: Fabric width usually ranges between 45 and 60. There are others, but make sure you have enough width. Fractions come in 1/8, 1/4, 3/8, 1/2, 5/8, 3,4, and up to a whole. Get your yard(s) and make sure you pick a fraction higher than your own."
             elsif waist > bust && waist > hip
                 puts "You need #{yardage3.to_i} and #{yardage3-yardage3.to_i} yard(s) with a #{width} width.  NOTE: Fabric width usually ranges between 45 and 60. There are others, but make sure you have enough width. Fractions come in 1/8, 1/4, 3/8, 1/2, 5/8, 3,4, and up to a whole. Get your yard(s) and make sure you pick a fraction higher than your own."
               else print"Doublecheck numbers. There is an error."
            end
          
            
          else 
            print "Check your measurements. Invalid input."
      end
  
  print "Thanks for stopping by! If you're done, hope we guessed right. If not, please try again."
ruby 2.5.5p157 (2019-03-15 revision 67260) [x86_64-linux]