Podcast #128: We chat with Kent C Dodds about why he loves React and discuss what life was like in the dark days before Git. Listen now.
Search type Search syntax
Tags [tag]
Exact "words here"
Author user:1234
user:me (yours)
Score score:3 (3+)
score:0 (none)
Answers answers:3 (3+)
answers:0 (none)
isaccepted:yes
hasaccepted:no
inquestion:1234
Views views:250
Sections title:apples
body:"apples oranges"
URL url:"*.example.com"
Favorites infavorites:mine
infavorites:1234
Status closed:yes
duplicate:no
migrated:no
wiki:no
Types is:question
is:answer
Exclude -[tag]
-apples
For more details on advanced search visit our help page
Results tagged with Search options user 59530

A competition to solve a particular problem through the usage and manipulation of strings.

4
votes
R, 77 bytes cat(c('Rrrr','Rr','-')[match(scan(,''),c('long','short','pause'))],sep=' - ') Takes input through STDIN, checks whether the input matches long, short or pause and swaps the matches fo …
answered Aug 25 '17 by JAD
2
votes
R, 29 bytes invisible(openssl::askpass()) Built-in that handles password entries. Opens a new window and replaces the input with dots. invisible is used to suppress printing the password to STDOUT. …
answered Jun 11 '17 by JAD
0
votes
R, 121 bytes m=rbind(a<-rep("-",9),b<-c("|",rep(" ",7),"|"),a,b,rep("x",9),b,a,b,a);m[c(4,6),5]="|";for(i in 1:9)cat(m[i,],"\n",sep="") First time trying a Kolmogorov-Complexity challenge, not sure …
answered Dec 19 '16 by JAD
1
vote
R, 104 105 bytes f=format;repeat{Sys.sleep(1);q=Sys.time();if(f(q,"%M%S")=="0000")print(rep("BONG",as.double(f(q,"%I"))))} Each second, it will (should) test whether we are at the end of an hour, t …
answered Dec 25 '16 by JAD
0
votes
R (+pryr), 45 bytes Different (and longer) solution than @Guiseppe's. f=pryr::f(`if`(sum(x|1),f(s[-x[1]],x[-1]),s)) which evaluates to the function: function (s, x) if (sum(x | 1)) f(s[-x[1]], x …
answered Aug 13 '17 by JAD
4
votes
R, 44 43 bytes Crossed out 44 is still regular 44 ;( This answer already provides a decent solution, but we can save some more bytes. function(x)repeat{cat(x);Sys.sleep(T<-T*2)} Anonymous functio …
answered May 9 '17 by JAD
5
votes
R, 95 79 93 bytes function(x){y=as.double(el(strsplit(x,"")));z=y%*%c((q<-length(y)):2,-1);(z&!z%%11&q>7&q<10)} Unnamed function that takes a string as argument. At first I overread the … requirement of having a string as input instead of a number, but that's good, because it saves some bytes on conversion. I am not sure how to interpret the array of characters, but if that means that you can …
answered Dec 8 '16 by JAD
2
votes
R, 41 bytes pryr::f(for(i in 1:x){cat(i);cat(x-i+1)}) pryr::f() creates a function that takes one input. Loops over 1:x and prints each element of 1:x along with each element of x:1. Prints to STDO …
answered May 30 '17 by JAD
5
votes
R, 107 97 bytes function(x)for(i in 1:max(lengths(x))){for(m in x)if(i<=length(m))cat(m[i],'\r',sep='');cat(' ')} Doesn't appear to work on TIO, which might be related to the use of the \r carriage …
answered Jun 5 by JAD
2
votes
R, 51 bytes Same length as the other R answer, but a different approach. cat(sample(c(letters,LETTERS,0:9),scan(),T),sep="") letters and LETTERS both are built-in variables containing all lower an …
answered May 5 '17 by JAD