; Nick: kLoKeR (kloker@gmail.com y kloker@iespana.es) concurso1 { var %t = $ticks | hmake tb 100 | .fopen a refranes.txt | tokenize 32 $remove($fread(a),¿,!,.,:,;,?,$chr(44)) while ((!$feof(a)) || $0) { var %j = $0 | while ( %j > 0 ) { hadd tb $ [ $+ [ %j ] ] 1 | dec %j } tokenize 32 $remove($fread(a),¿,!,.,:,;,?,$chr(44)) } .fclose a | %re = $hget(tb,0).item | hfree tb | echo kLoKeR: Palabras: %re - Tiempo: $calc($ticks - %t) $+ ms } ; Nick: xlony concurso2 { var %t = $ticks var %x = 1 $iif($hget(refranes,0).item,hfree refranes) | $iif($hget(debug,0).item,hfree debug) while ($read(refranes.txt,%x)) { var %y = 1 hadd -m debug texto $remove($v1,.,?,¿,!,¡,:,;,$chr(44)) while ($gettok($hget(debug,1).data,%y,32)) { hadd -m refranes $v1 1 inc %y } inc %x } echo xlony: Palabras: $hget(refranes,0).item - Tiempo: $+($calc($ticks - %t),ms) } ; Nick: anónimo (gorriion@hotmail.com) concurso3 { var %t $ticks .fopen concurso $+(",$mircdirrefranes.txt,") | hmake concurso 100 | var %e /([^[:space:]¿?¡!.,;:]+)/g while (!$feof(concurso)) { if ( $regex($fread(concurso),%e) ) { var %i = $regml(0) | while (%i > 0) { hadd concurso $regml(%i) 1 | dec %i } } } var %i = $hget(concurso,0).item | .fclose concurso | hfree concurso echo anónimo1: Palabras: %i - Tiempo: $calc($ticks - %t) $+ ms } ; Nick: GONZO (gonzomail@gmail.com) concurso4 { var %t = $ticks unset %palabras var %b = 1,%f = a hmake palabras while (%f) { var %bb = 1,%p = $gettok(%f,1,32),%f = $remove($read(refranes.txt,%b),¿,!,.,:,;,?,$chr(44)) while (%p) { if !$hget(palabras,%p) { hadd -m palabras %p a | inc %palabras } var %p = $gettok(%f,%bb,32) inc %bb } inc %b } hfree palabras | echo GONZO: Palabras: %palabras - Tiempo: $calc($ticks - %t) $+ ms } ; Nick: Lz (elezeta@gmail.com) concurso5 { var %t = $ticks,%y = 1 hmake f 10000 window -nh @c loadbuf @c refranes.txt while ($line(@c,%y)) { var %a = $remove($ifmatch,.,$chr(44),?,¡,¿,!,:,;),%x = 1 while ($gettok(%a,%x,32)) { hadd f $ifmatch inc %x } inc %y } var %p = $hget(f,0).item hfree f window -c @c echo Lz: Palabras: %p - Tiempo: $calc($ticks - %t) $+ ms } ; Nick: Racy (racy.2004@gmail.com) concurso6 { var %tiempo = $ticks $iif($hget(texto,0).item,hfree texto) $iif($hget(palabras,0).item,hfree palabras) var %a = 1 while ($read(refranes.txt,%a)) { var %b = 1 hadd -m palabras texto $remove($ifmatch,.,?,¿,!,¡,:,;,$chr(44)) while ($gettok($hget(palabras,1).data,%b,32)) { hadd -m texto $gettok($hget(palabras,1).data,%b,32) 1 inc %b } inc %a } echo Racy: Palabras: $hget(texto,0).item - Tiempo: $calc($ticks - %tiempo) $+ ms } ; Nick: Axayacatl concurso7 { var %t $ticks .hmake concurso 500 | .hmake palabras 200 hload -n concurso refranes.txt var %a = 1 while ($hget(concurso,%a)) { tokenize 32 $lower($remove($hget(concurso,%a).data,$chr(44),$chr(46),?,¿,¡,!,;,:)) var %b = 1 while ($gettok($1-,%b,32)) { if (!$hfind(palabras,$v1).item) .hadd palabras $gettok($1-,%b,32) inc %b } inc %a } echo Axayacatl: Palabras: $hget(palabras,0).item - Tiempo: $calc($ticks - %t) $+ ms .hfree palabras | .hfree concurso }