Skip to main content
Commonmark migration
Source Link

#VBA (Excel), 105, 101, 99 Bytes

VBA (Excel), 105, 101, 99 Bytes

Edit: -4 bytes from Keeta! Thanks!

Edit 2: -2 bytes from Chronocidal! Woot! (Realized that test cases only worked for 10. Fixed now)

Yeah, Excel beat VBA this time. Whatever. (We're coming for you)

d=vbCr:For i=1To[a1]:a=i Mod 3:?IIf(a=1,"Yeah"+d,"")IIf(i/2=i\2,"","But"+d)IIf(a=2,"No"+d,"");:Next

^This is pasted into the Immediate window and outputs to the debug window

Ungolfed

d = vbCr
'For 1 to the value in A1 (using 0 gave extra values, and VBA skips the for loop if 0)
For i = 1 To [a1]    'aka: Range("A1").value
    a = i mod 3
    '? is the same as Print (Debug.Print when not in the Immediate Window)
    Print IIf(a = 1, "Yeah" + d, "") _ '<-- Just a line continuation
          'Keeta taught me that the \ operator is division with truncation,
          '     so if they are equal then there is no remainder!
          IIf(i / 2 = i \ 2, "", "But" + d) _
          IIf(a = 2, "No" + d, "");
    'Print usually prints a newline, but it still outputs if the string is blank...
    '   So we append a newline -if true- and use a semi-colon to kill the newline
Next

#VBA (Excel), 105, 101, 99 Bytes

Edit: -4 bytes from Keeta! Thanks!

Edit 2: -2 bytes from Chronocidal! Woot! (Realized that test cases only worked for 10. Fixed now)

Yeah, Excel beat VBA this time. Whatever. (We're coming for you)

d=vbCr:For i=1To[a1]:a=i Mod 3:?IIf(a=1,"Yeah"+d,"")IIf(i/2=i\2,"","But"+d)IIf(a=2,"No"+d,"");:Next

^This is pasted into the Immediate window and outputs to the debug window

Ungolfed

d = vbCr
'For 1 to the value in A1 (using 0 gave extra values, and VBA skips the for loop if 0)
For i = 1 To [a1]    'aka: Range("A1").value
    a = i mod 3
    '? is the same as Print (Debug.Print when not in the Immediate Window)
    Print IIf(a = 1, "Yeah" + d, "") _ '<-- Just a line continuation
          'Keeta taught me that the \ operator is division with truncation,
          '     so if they are equal then there is no remainder!
          IIf(i / 2 = i \ 2, "", "But" + d) _
          IIf(a = 2, "No" + d, "");
    'Print usually prints a newline, but it still outputs if the string is blank...
    '   So we append a newline -if true- and use a semi-colon to kill the newline
Next

VBA (Excel), 105, 101, 99 Bytes

Edit: -4 bytes from Keeta! Thanks!

Edit 2: -2 bytes from Chronocidal! Woot! (Realized that test cases only worked for 10. Fixed now)

Yeah, Excel beat VBA this time. Whatever. (We're coming for you)

d=vbCr:For i=1To[a1]:a=i Mod 3:?IIf(a=1,"Yeah"+d,"")IIf(i/2=i\2,"","But"+d)IIf(a=2,"No"+d,"");:Next

^This is pasted into the Immediate window and outputs to the debug window

Ungolfed

d = vbCr
'For 1 to the value in A1 (using 0 gave extra values, and VBA skips the for loop if 0)
For i = 1 To [a1]    'aka: Range("A1").value
    a = i mod 3
    '? is the same as Print (Debug.Print when not in the Immediate Window)
    Print IIf(a = 1, "Yeah" + d, "") _ '<-- Just a line continuation
          'Keeta taught me that the \ operator is division with truncation,
          '     so if they are equal then there is no remainder!
          IIf(i / 2 = i \ 2, "", "But" + d) _
          IIf(a = 2, "No" + d, "");
    'Print usually prints a newline, but it still outputs if the string is blank...
    '   So we append a newline -if true- and use a semi-colon to kill the newline
Next
-2 bytes, Fixed to mirror weird JavaScript Modulus operator
Source Link

#VBA (Excel), 105, 101, 10199 Bytes

Edit: -4 bytes from Keeta! Thanks!

Yeah, Excel beat VBA this time. WhateverEdit 2: -2 bytes from Chronocidal! Woot! (Realized that test cases only worked for 10. Fixed now)

Yeah, Excel beat VBA this time. Whatever. (We're coming for you)

d=vbCr:For i=0To[a1]i=1To[a1]:a=i Mod 3:?IIf(i/3=i\3a=1,"Yeah"&d"Yeah"+d,"")&IIfIIf(i/2=i\2,"But"&d,"","But"+d)&IIfIIf(i Mod 3=1a=2,"No"&d"No"+d,"");:Next

^This is pasted into the Immediate window and outputs to the debug window

Ungolfed

d = vbCr
'For 1 to the value in A1 (using 0 gave extra values, and VBA skips the for loop if 0)
For i = 01 To [a1]    'aka: Range("A1").value
    'Printa usually= printsi amod newline,3
 but it still outputs'? ifis the stringsame isas blank..Print (Debug.
 Print when not in the 'Immediate Window)
  So we appendPrint IIf(a newline= -if1, true-"Yeah" and+ used, a"") semi_ '<-colon- toJust killa theline newlinecontinuation
          'Keeta taught me that the \ operator is division with truncation,
          '     so if they are equal then there is no remainder!
    '? is the same as Print
    Print IIf(i \/ 32 = i /\ 32,"Yeah" & d,"") & _ '<--, Just"But" a+ lined) continuation_
          IIf(i \ 2a = i / 2,"But" &"No" + d, "");
 & _  'Print usually prints a newline, but it still outputs if the string is blank...
    '   So we append IIf(ia Modnewline 3-if =true- 1,"No"and &use d,"");a semi-colon to kill the newline
Next

#VBA (Excel), 105, 101 Bytes

Edit: -4 bytes from Keeta! Thanks!

Yeah, Excel beat VBA this time. Whatever.

d=vbCr:For i=0To[a1]:?IIf(i/3=i\3,"Yeah"&d,"")&IIf(i/2=i\2,"But"&d,"")&IIf(i Mod 3=1,"No"&d,"");:Next

^This is pasted into the Immediate window and outputs to the debug window

Ungolfed

d = vbCr
'For 1 to the value in A1 (using 0 gave extra values, and VBA skips the for loop if 0)
For i = 0 To [a1]    'aka: Range("A1").value
    'Print usually prints a newline, but it still outputs if the string is blank...
     '   So we append a newline -if true- and use a semi-colon to kill the newline
    'Keeta taught me that the \ operator is division with truncation,
    '     so if they are equal then there is no remainder!
    '? is the same as Print
    Print IIf(i \ 3 = i / 3,"Yeah" & d,"") & _ '<-- Just a line continuation
          IIf(i \ 2 = i / 2,"But" & d,"") & _
          IIf(i Mod 3 = 1,"No" & d,"");
Next

#VBA (Excel), 105, 101, 99 Bytes

Edit: -4 bytes from Keeta! Thanks!

Edit 2: -2 bytes from Chronocidal! Woot! (Realized that test cases only worked for 10. Fixed now)

Yeah, Excel beat VBA this time. Whatever. (We're coming for you)

d=vbCr:For i=1To[a1]:a=i Mod 3:?IIf(a=1,"Yeah"+d,"")IIf(i/2=i\2,"","But"+d)IIf(a=2,"No"+d,"");:Next

^This is pasted into the Immediate window and outputs to the debug window

Ungolfed

d = vbCr
'For 1 to the value in A1 (using 0 gave extra values, and VBA skips the for loop if 0)
For i = 1 To [a1]    'aka: Range("A1").value
    a = i mod 3
    '? is the same as Print (Debug.Print when not in the Immediate Window)
    Print IIf(a = 1, "Yeah" + d, "") _ '<-- Just a line continuation
          'Keeta taught me that the \ operator is division with truncation,
          '     so if they are equal then there is no remainder!
          IIf(i / 2 = i \ 2, "", "But" + d) _
          IIf(a = 2, "No" + d, "");
    'Print usually prints a newline, but it still outputs if the string is blank...
    '   So we append a newline -if true- and use a semi-colon to kill the newline
Next
Fixed number values in explanation to match original code. Added print explain to get to minimum edit size
Source Link

#VBA (Excel), 105, 101 Bytes

Edit: -4 bytes from Keeta! Thanks!

Yeah, Excel beat VBA this time. Whatever.

d=vbCr:For i=0To[a1]:?IIf(i/3=i\3,"Yeah"&d,"")&IIf(i/2=i\2,"But"&d,"")&IIf(i Mod 3=1,"No"&d,"");:Next

^This is pasted into the Immediate window and outputs to the debug window

Ungolfed

d = vbCr
'For 1 to the value in A1 (using 0 gave extra values, and VBA skips the for loop if 0)
For i = 10 To [a1]    'aka: Range("A1").value
    'Print usually prints a newline, but it still outputs if the string is blank...
    '   So we append a newline -if true- and use a semi-colon to kill the newline
    'Keeta taught me that the \ operator is division with truncation,
    '     so if they are equal then there is no remainder!
    '? is the same as Print
    Print IIf(i \ 3 = i / 3,"Yeah" & d,"") & _ '<-- Just a line continuation
          IIf(i \ 32 = i / 2,"But" & d,"") & _
          IIf(i Mod 3 = 1,"No" & d,"");
Next

#VBA (Excel), 105, 101 Bytes

Edit: -4 bytes from Keeta! Thanks!

Yeah, Excel beat VBA this time. Whatever.

d=vbCr:For i=0To[a1]:?IIf(i/3=i\3,"Yeah"&d,"")&IIf(i/2=i\2,"But"&d,"")&IIf(i Mod 3=1,"No"&d,"");:Next

^This is pasted into the Immediate window and outputs to the debug window

Ungolfed

d = vbCr
'For 1 to the value in A1 (using 0 gave extra values, and VBA skips the for loop if 0)
For i = 1 To [a1]    'aka: Range("A1").value
    'Print usually prints a newline, but it still outputs if the string is blank...
    '   So we append a newline -if true- and use a semi-colon to kill the newline
    'Keeta taught me that the \ operator is division with truncation,
    '     so if they are equal then there is no remainder!
    Print IIf(i \ 3 = i / 3,"Yeah" & d,"") & _ '<-- Just a line continuation
          IIf(i \ 3 = i / 2,"But" & d,"") & _
          IIf(i Mod 3 = 1,"No" & d,"");
Next

#VBA (Excel), 105, 101 Bytes

Edit: -4 bytes from Keeta! Thanks!

Yeah, Excel beat VBA this time. Whatever.

d=vbCr:For i=0To[a1]:?IIf(i/3=i\3,"Yeah"&d,"")&IIf(i/2=i\2,"But"&d,"")&IIf(i Mod 3=1,"No"&d,"");:Next

^This is pasted into the Immediate window and outputs to the debug window

Ungolfed

d = vbCr
'For 1 to the value in A1 (using 0 gave extra values, and VBA skips the for loop if 0)
For i = 0 To [a1]    'aka: Range("A1").value
    'Print usually prints a newline, but it still outputs if the string is blank...
    '   So we append a newline -if true- and use a semi-colon to kill the newline
    'Keeta taught me that the \ operator is division with truncation,
    '     so if they are equal then there is no remainder!
    '? is the same as Print
    Print IIf(i \ 3 = i / 3,"Yeah" & d,"") & _ '<-- Just a line continuation
          IIf(i \ 2 = i / 2,"But" & d,"") & _
          IIf(i Mod 3 = 1,"No" & d,"");
Next
added 187 characters in body
Source Link
Loading
added 14 characters in body
Source Link
Loading
Source Link
Loading