# Search Results

Results tagged with
Search options not deleted user 36733
13 results

Code-golf is a competition to solve a particular problem in the fewest bytes of source code.

1 vote

### The time after some time

VBA (150149 bytes) Function t(s) x = Split(Replace(Replace(Replace(s, "s", ""), "m", " "), "h", " ")) t = Format(TimeSerial(x(0), x(1), x(2)), "HH:MM:SS") End Function
• 439
1k views

### Variable Prime "Twins"

I am 2/3 twins with my brother, i.e. born on the same day of the same month but twelve years later. When I was 5, he was 17, both primes; the last pair of ages we can reasonably count on is [71, 83] w …
• 439

### How much code would a codegolf golf if a codegolf could golf code?

VBA, 107 bytes Function q(a,b) b=b&" " c="ould " q="How much "&a&" w"&c&"a "&a&b&b&"if a "&a&b&"c"&c&b&a&"?" End Function Should run as VBScript too, I used two shortcuts: "ould " is repeating and …
• 439

### Running length of the movie in a human readable format

VBA, 175 bytes Sub e(f) f = Val(f) h = Int(f / 60) m = f - h * 60 MsgBox IIf(h > 0, h & " hour" & IIf(h > 1, "s", ""), "") & " " & IIf(m > 0, m & " minute" & IIf(m > 1, "s", ""), "") End Sub
• 439
1 vote

VBA, 69 bytes Function x(s) g=Split(s, ",") x=CDate(g(0))-CDate(g(1)) End Function
• 439

### When is Thanksgiving?

VBA, 124 bytes * 75% = 93 bytes Function e(y) For i = 1 To 7 x = DateSerial(y, 11, 21) + i If Weekday(x) = 5 Then e = Format(x, "mmm dd") Next End Function I'm not sure if spaces count, it's somewh …
• 439
303 views

### Array combinatoric comparison

Introduction You may remember sudoku, where there can only be one of each number in each row, column and block of nine. The general idea is that if the array contains but one element, you can submit …
• 439

### Forecast Palindromic Dates

VBA, 240 193 bytes Function f(a, b) Dim j, g() For i = CDate(a) To CDate(b) If Format(i, "yyyy") = StrReverse(Format(i, "mmdd")) Then ReDim Preserve g(j) g(j) = Format(i, "yyyy-mm …
• 439
1 vote

### Convert a string of digits from words to an integer

VBA, 160 bytes Function e(s) s = Split(s, " ") For i = LBound(s) To UBound(s) s(i) = Int((InStr("ontwthfofisiseeini", Left(s(i), 2)) + 1) / 2) Next e = Val(Join(s, "")) End Function Matches the fir …
• 439

### Substring Sum Set

VBA, 160 bytes Function e(g()) Dim h() k=LBound(g) l=UBound(g) ReDim h(k To l) On Error Resume Next For i=k To l For j=i To i+g(i)-1 h(i)=h(i)+g(j) Next Next e=h End Function
• 439

### Goodness Giza Golf!

VBA, 175 bytes Function e(s) As Boolean Dim f As Long For i=1 To Int(Len(s)/2)+1 x=Mid(s,i,1) If f<>0 And ((f+1)<>x) Or (x<>Mid(s,Len(s)-i+1,1)) Then Exit Function f=x Next e=1 End Function
• 439