RGB2Rv6/Codegolf: Difference between revisions
Jump to navigation
Jump to search
No edit summary |
No edit summary |
||
Line 16: | Line 16: | ||
= nichtbestätigte Scores = | = nichtbestätigte Scores = | ||
* (wird nicht bewertet da Jury) sECuRE in C mit 218 Glyphs (und 218 Bytes) | * (wird nicht bewertet da Jury) sECuRE in C mit 218 Glyphs (und 218 Bytes) | ||
= Lösungen = | |||
== urs (Perl) == | |||
$c{" "}=2;$#[19]=$#[23]=1;map{map{$c{$_}=(abs($.-3)+1+$#[$.+$?*4])*(5,4,3,(2)x4,3,4,5)[$?++]}split" ",<>;`-`}1..4;$/=\1;map{$?+=$c{$_}}<>;print$? | |||
== blubberdiblub == | |||
Folgt (als Foto) | |||
== martl (Java) == | |||
import java.util.*;class M{public static void main(String[]z){String a="",t="";Scanner S=new Scanner(System.in);while(S.hasNext()){a+=t;t=S.nextLine();}int s=0;for(char c:t.toCharArray()){s+=2;s+=c==' '?0:new int[]{13,10,7,4,4,4,4,7,10,13,8,6,4,2,2,2,2,4,6,8,3,2,1,0,2,2,0,1,2,8,6,4,2,2,2,2}[a.replaceAll(" ","").indexOf(c)];}System.out.println(s);}} | |||
== Moredread (Python) == | |||
import sys | |||
i,u,O,t,v,x=0,sys.stdin.read().split('\n'),lambda O:O[::-1]+O,[4,2,3,4,5],[4,4,6,8,10],[6,6,8,12,15] | |||
p=O(x),O(v),O(t),O(v) | |||
for c in u[4]: | |||
if c is " ": | |||
i+=2 | |||
continue | |||
for g in 0,1,2,3: | |||
L=u[g].find(c)/2 | |||
if L!=-1:i+=p[g][L] | |||
print i | |||
== sECuRE (C) == | |||
main(){char i[4096];read(0,i,4096);char*p="pcmajagagagagajamapakaiagaeaeaeaeagaiakafaeadacaeaeacadaeafakaiagaeaeaeaeagaiaka",*n=strchr(i+58,10),*c,*s=0;*n++=0;for(c=n;*c!=0;c++)s+=p[strchr(i,*c)-i]-97;printf("%d",s);} |
Revision as of 22:20, 31 October 2009
Codegolf auf der RGB2Rv6
Die Aufgabe findet sich unter https://www.noname-ev.de/w/File:Rgb2rv6-codegolf.pdf
Sieger
- Platz 1: urs in Perl mit 146 Bytes
- Platz 2: blubberdiblub in unerweitertem C64-BASIC mit 176 Glyphs (und 155 Bytes)
- Platz 3: martl in Java mit 350 Bytes
Originellste Lösung: blubberdiblub in C64-BASIC
Leider nicht gewonnen
- Moredread in Python (249 Zeichen)
nichtbestätigte Scores
- (wird nicht bewertet da Jury) sECuRE in C mit 218 Glyphs (und 218 Bytes)
Lösungen
urs (Perl)
$c{" "}=2;$#[19]=$#[23]=1;map{map{$c{$_}=(abs($.-3)+1+$#[$.+$?*4])*(5,4,3,(2)x4,3,4,5)[$?++]}split" ",<>;`-`}1..4;$/=\1;map{$?+=$c{$_}}<>;print$?
blubberdiblub
Folgt (als Foto)
martl (Java)
import java.util.*;class M{public static void main(String[]z){String a="",t="";Scanner S=new Scanner(System.in);while(S.hasNext()){a+=t;t=S.nextLine();}int s=0;for(char c:t.toCharArray()){s+=2;s+=c==' '?0:new int[]{13,10,7,4,4,4,4,7,10,13,8,6,4,2,2,2,2,4,6,8,3,2,1,0,2,2,0,1,2,8,6,4,2,2,2,2}[a.replaceAll(" ","").indexOf(c)];}System.out.println(s);}}
Moredread (Python)
import sys i,u,O,t,v,x=0,sys.stdin.read().split('\n'),lambda O:O[::-1]+O,[4,2,3,4,5],[4,4,6,8,10],[6,6,8,12,15] p=O(x),O(v),O(t),O(v) for c in u[4]: if c is " ": i+=2 continue for g in 0,1,2,3: L=u[g].find(c)/2 if L!=-1:i+=p[g][L] print i
sECuRE (C)
main(){char i[4096];read(0,i,4096);char*p="pcmajagagagagajamapakaiagaeaeaeaeagaiakafaeadacaeaeacadaeafakaiagaeaeaeaeagaiaka",*n=strchr(i+58,10),*c,*s=0;*n++=0;for(c=n;*c!=0;c++)s+=p[strchr(i,*c)-i]-97;printf("%d",s);}