Skip to main content
We’ve updated our Terms of Service. A new AI Addendum clarifies how Stack Overflow utilizes AI interactions.
Code Golf

Return to Answer

Commonmark migration
Source Link

#Perl, 88 bytes

Perl, 88 bytes

@_=/./g;a:{for(0..@_-2){@_[$_,$_+1]=@_[$_+1,$_],redo a if uc$_[$_]gt uc$_[$_+1]}}print@_

Just a simple Bubble Sort. Call with -n option to pass the text.

e.g:

echo "tThHiIsS" | perl -n sort2.pl

Output:

hHiIsStT

#Perl, 88 bytes

@_=/./g;a:{for(0..@_-2){@_[$_,$_+1]=@_[$_+1,$_],redo a if uc$_[$_]gt uc$_[$_+1]}}print@_

Just a simple Bubble Sort. Call with -n option to pass the text.

e.g:

echo "tThHiIsS" | perl -n sort2.pl

Output:

hHiIsStT

Perl, 88 bytes

@_=/./g;a:{for(0..@_-2){@_[$_,$_+1]=@_[$_+1,$_],redo a if uc$_[$_]gt uc$_[$_+1]}}print@_

Just a simple Bubble Sort. Call with -n option to pass the text.

e.g:

echo "tThHiIsS" | perl -n sort2.pl

Output:

hHiIsStT
Rollback to Revision 2
Source Link
samgak
  • 1.7k
  • 15
  • 25

#Perl, 8688 bytes

@_=/./g;a:{for(0..@_-2){@_[$_,$_+1]=@_[$_+1,$_],redo a if uc$_[$_]>uc$_[$_+1]uc$_[$_]gt uc$_[$_+1]}}print@_

Just a simple Bubble Sort. Call with -n option to pass the text.

e.g:

echo "tThHiIsS" | perl -n sort2.pl

Output:

hHiIsStT

#Perl, 86 bytes

@_=/./g;a:{for(0..@_-2){@_[$_,$_+1]=@_[$_+1,$_],redo a if uc$_[$_]>uc$_[$_+1]}}print@_

Just a simple Bubble Sort. Call with -n option to pass the text.

e.g:

echo "tThHiIsS" | perl -n sort2.pl

Output:

hHiIsStT

#Perl, 88 bytes

@_=/./g;a:{for(0..@_-2){@_[$_,$_+1]=@_[$_+1,$_],redo a if uc$_[$_]gt uc$_[$_+1]}}print@_

Just a simple Bubble Sort. Call with -n option to pass the text.

e.g:

echo "tThHiIsS" | perl -n sort2.pl

Output:

hHiIsStT
deleted 2 characters in body
Source Link
samgak
  • 1.7k
  • 15
  • 25

#Perl, 8886 bytes

@_=/./g;a:{for(0..@_-2){@_[$_,$_+1]=@_[$_+1,$_],redo a if uc$_[$_]gt uc$_[$_+1]uc$_[$_]>uc$_[$_+1]}}print@_

Just a simple Bubble Sort. Call with -n option to pass the text.

e.g:

echo "tThHiIsS" | perl -n sort2.pl

Output:

hHiIsStT

#Perl, 88 bytes

@_=/./g;a:{for(0..@_-2){@_[$_,$_+1]=@_[$_+1,$_],redo a if uc$_[$_]gt uc$_[$_+1]}}print@_

Just a simple Bubble Sort. Call with -n option to pass the text.

e.g:

echo "tThHiIsS" | perl -n sort2.pl

Output:

hHiIsStT

#Perl, 86 bytes

@_=/./g;a:{for(0..@_-2){@_[$_,$_+1]=@_[$_+1,$_],redo a if uc$_[$_]>uc$_[$_+1]}}print@_

Just a simple Bubble Sort. Call with -n option to pass the text.

e.g:

echo "tThHiIsS" | perl -n sort2.pl

Output:

hHiIsStT
Post Undeleted by samgak
added 6 characters in body
Source Link
samgak
  • 1.7k
  • 15
  • 25
Loading
Post Deleted by samgak
Source Link
samgak
  • 1.7k
  • 15
  • 25
Loading

AltStyle によって変換されたページ (->オリジナル) /