Su trabajo es abrir una ventana del navegador del navegador predeterminado a http://codegolf.stackexchange.com .
Su código debe abrir el navegador y no puede confiar en uno abierto.
Este es el código de golf , por lo que gana la respuesta más corta en bytes.

Respuestas:
GNU Emacs,
292714 bytesEWW es un navegador dentro de Emacs. La
browse-webfunción es un alias paraeww, y eso hace queewwel navegador predeterminado en Emacs:Gracias a @CoolestVeto, @Jonathan Leech-Pepin y @ zyabin101.
fuente
www.ppcg.lollugar dehttp://ppcg.lol?//, no creo. (No uso emacs, pero generalmente se acepta sin el//)Oración , 41 bytes
No ganar, pero seguro fue divertido. ¡A partir de ahora, solo estoy 1 bytee detrás de Python!
Explicación:
I needcompila aimport $1conwebbrowserser el módulo.Nowejecuta el siguiente comando desde el módulo comomodule.commandcon los argumentos de todo lo que sigue.Entonces esto se compila para:
Sin
http:embargo, termino necesitando la parte, y no se puede acortar.fuente
"http://ppcg.lol"con"http:ppcg.lol". No estoy seguro de si puedes eliminar el espacio entreopeny"http:...", pero ¿intentarlo?Lote, 17 bytes
Guardado 3 bytes gracias a Mego.
Esto se abrirá en su navegador predeterminado si lo ejecuta desde la línea de comandos de Windows.
Creo que también funcionará en Powershell, pero no estoy seguro.
fuente
startlugar deexplorer.start www.ppcg.lollugar, puede utilizarlo para que Windows lo analice implícitamente como HTTP. Funciona tanto en CMD como en PowerShell.www.?PowerShell,
1716 bytesUsando un dominio aún más corto proporcionado por Milo.
Si bien
startes un alias conocido,Start-Processhay otro parasaps. Puedes ver esto desdeGet-Alias. Sigue la convención para similaresStart-yStop-cmdlets.fuente
Terminal (OSX),
201817 bytesGuardado 2 gracias a CoolestVeto
fuente
openes una utilidad OSX, no bash; esto se llamaría más apropiadamente "línea de comando OSX".//.open http:ppcg.gaMATLAB,
2825 byteswwwes más cortohttp://y garantiza que la dirección se procese como una URLweb('www.ppcg.lol', '-browser').web ppcg.lol -browserya que MATLAB agregará automáticamente unhttp://( 21 bytes )Alternativas :
En Windows, esto se puede acortar a ( 19 bytes )
En OS X ( 21 bytes )
Lo siguiente funcionaría en una aplicación MATLAB implementada ( 16 bytes )
Si se pudiera usar el navegador incorporado, esto podría reducirse aún más, como
httpestá implícito ( 12 bytes )fuente
opencomando incorporado hace lo mismo.!hace en MATLAB, es el equivalente desystem(command). Lo tuve como una demostración de otras alternativas que podrían ejecutarse desde MATLAB. ¿Eso esta bien?www.?wwwis unnecessary only on OS XAutoHotKey, 16 bytes
fuente
Python,
5248474544 bytesShamelessly borrowing that shortened link.
Thanks to CrazyPython for -4 bytes, and Sp3000 for a further one.
Edit: shaved 2 more off thanks to CoolestVeto
Edit: thanks to MD XF for registering ppcg.ga and saving another byte
fuente
//.python -m webbrowser -t http:ppcg.lolwhich I think counts as 30 charsppcg.lolhas been unregistered, invalidating this answer :I However, I just registeredppcg.ga, so you can use that instead, saving a byte anyway.Bash,
2422 bytesNot as short as some others.
firefox ppcg.lolis shorter, but it doesn't meet question spec.fuente
xdg-open www.ppcg.lolworks for me as well.//.xdg-open http:ppcg.lolalso works for me.Java 7,
118115 bytesJava is not the best language for golfing... Here's the same program in a more readable format:
Saved 2 bytes by removing
//in the URI/L, and another byte by switching to.gafrom.lol(indirectly thanks to @Milo)fuente
"http://ppcg.lol"with"http:ppcg.lol"void f(){ .... }would be enough.Pylongolf, 11 bytes (Non-Competing)
Pushes ppcg.lol into the stack then
popens it.fuente
Java 8,
115112 bytesJava is not the best language for golfing... Here's the same program in a more readable format:
Saved 2 bytes by removing
//(thanks @CoolestVeto), and another byte by switching to.gafrom.lol(indirect thanks to @Milo)fuente
//.interfaceis longer thanclass, you save more bytes because thepublicmodifier is implied.JavaScript, 34 bytes
Uses Node.js
fuente
//?require`open``http://ppcg.lol`;(added;to avoid tripping the formatting)require('open')('//ppcg.lol')to save 5 bytesppcg.lolhas been unregistered, invalidating this answer :I However, I just registeredppcg.ga, so you can use that instead, saving a byte anyway.Racket,
4140 bytesfuente
ppcg.lolhas been unregistered, invalidating this answer :I However, I just registeredppcg.ga, so you can use that instead, saving a byte anyway.Applescript, 28 bytes
fuente
ppcg.lolhas been unregistered, invalidating this answer :I However, I just registeredppcg.ga, so you can use that instead, saving a byte anyway.Mathematica, 28 bytes
fuente
//?R, 26 bytes
shell.exec("www.ppcg.lol")I don't know of any shorter way to do this in R.
fuente
system/fork/whatever call is a trivial modification.ppcg.lolhas been unregistered, invalidating this answer :I However, I just registeredppcg.ga, so you can use that instead, saving a byte anyway.Actionscript 3, 117 bytes
Like Java, this is not a great golfing language. Here's the code with formatting:
fuente
ppcg.lolhas been unregistered, invalidating this answer :I However, I just registeredppcg.ga, so you can use that instead, saving a byte anyway.Rebol 2,
1615 bytesif you accept an error before opening the page on Linux, no error on Windows
20 bytes without an error
fuente
browse #ppcg.lolPerl 5,
6657 bytesShould work everywhere, but needs that import :(
8 bytes saved with @msh210 comment.
Also, for funsies :
Perl 5 (Windows), 34 bytes
Perl 5 (Unix), 31 bytes
fuente
-Minstead ofuseto shave a coupla bytes. (Untested.) Also, I'm guessing you don't need the parens or thewww.. (Also untested.)ppcg.lolhas been unregistered, invalidating this answer :I However, I just registeredppcg.ga, so you can use that instead, saving a byte anyway.Common Lisp, 31 bytes
fuente
RFO-BASIC, 22 bytes
Read about RFO-BASIC at laughton.com.
fuente
ppcg.lolhas been unregistered, invalidating this answer :I However, I just registeredppcg.ga, so you can use that instead, saving a byte anyway. Also, couldn't the space betweenBROWSEand"be removed, saving another byte?VBScript, 57 bytes
I used to have lots of fun creating tiny programs in VBScript, back in 2010.
I've remembered this language and used the code on: https://stackoverflow.com/a/13401872/2729937
It still works on Windows 7, at least.
This is a bit different from the usual
start www.ppcg.lol, in the sense that it executes thewww.ppcg.gadirectly, with an implicitstart.An alternative way would be
"cmd.exe /C start www.ppcg.ga".fuente
ppcg.lolhas been unregistered, invalidating this answer :I However, I just registeredppcg.ga, so you can use that instead, saving a byte anyway.C#, 33 bytes
Opens the default browser to the web address
fuente
\\via//.System.Diagnosticsnamespace to be added in orProcessto be fully qualified to work.ppcg.lolhas been unregistered, invalidating this answer :I However, I just registeredppcg.ga, so you can use that instead, saving a byte anyway.05AB1E, 16 bytes (non-competing)
Non-competing, since the features used here postdate the challenge. Code:
You can try the string online here. This basically evaluates to this batch answer.
Uses the CP1252 encoding.
fuente
VB.NET,
3230 bytesfuente
Sub Main(), and +7 forEnd Sub, which you need in order to run this at least in a VB.NET console program, also you would need to importSystem.Diagnostics.ppcg.lolhas been unregistered, invalidating this answer :I However, I just registeredppcg.ga, so you can use that instead, saving a byte anyway.Factor,
383626 bytesI didn't know one could golf-off the
//in the protocol.fuente
run-process, and you can wholly drop//.//could be left off. As for the space between"andrun-process, dropping that would require a word named"run-processto be present in the current vocabulary search pathsystem/fork/whatever call is a trivial modification.xdg-openin languages which are not equipped with special functions for browsing the web. A C or ASM answer would surely also have to dosystem("xdg-open...")Python, 44 bytes
URL from this commentEdit: ppcg.ga seems to become more popular now (but it WAS available when I posted this answer).
Ungolfed:
Python, 44 bytes
URL from this answer
Ungolfed:
Python, 45 bytes
Ungolfed:
Take that, ppcg.lol! (1 byte shorter)
Note: I added a separate answer leading to ppcg.lol, 'cause I've noticed the other sites doesn't work for me in Internet explorer 11, and I saw other users having this problem too.
Both are non-non-competing (read that right?)
fuente
Ruby,
222019 bytes (on OS X)Simple.
Thanks to Daniel for 2 bytes off.
fuente
%x.open http:ppcg.lolCheddar, 65 bytes
Accesses cheddar internals and then calls upon
openpackage and calls it with string to PPCG. Make sure you haveopennpm package installedfuente