g | x | w | all
Bytes Lang Time Link
082AWK250825T193515Zxrs
015Uiua231021T191044Zchunes
063Zsh221110T175550Zroblogic
004Nekomata230720T100914Zalephalp
002Thunno 2 G230720T090822ZThe Thon
018Octave230428T191139ZHunaphu
022Arturo221109T065356Zchunes
094Lua230429T191942Zbluswimm
009Stax230227T160741Zemirps
014CJam230221T145428Zemirps
035><>221220T000727ZJo King
4440><>221108T142550ZEmigna
070Python 3221219T120624ZU13-Forw
030Juby221115T204442ZJordan
027Raku221114T172938Zhkdtam
120C++ gcc221110T010143Zhuanglx
125TSQL221108T144605Zt-clause
031MATLAB221108T133617Zrobbie c
081C clang221105T154955Zjdt
073PHP 8.x221105T161345ZIsmael M
nan><>221105T180314Zmousetai
009Japt h221105T184625ZShaggy
108Go221107T144813Zbigyihsu
012BQN221108T182939ZDLosc
013APLDyalog Unicode221108T165143ZAiden Ch
018J221108T154424Zsouth
056Java 8221107T100809ZKevin Cr
004MathGolf221107T094021ZKevin Cr
070Excel ms365221107T074823ZJvdV
034Julia221106T090819ZKirill L
011K ngn/k221105T143754Zoeuf
056Knight v2221106T022317ZAiden Ch
068Wren221106T014942Zchunes
012Pip221106T011732ZAiden Ch
00405AB1E221105T141801ZThe Thon
004Jelly221105T205333ZnaffetS
nanFig221105T203139ZnaffetS
003Vyxal G221105T202548ZnaffetS
029Mathematica221105T202325Zhakr14
007Pyth221105T202101Zhakr14
038R221105T200451Zpajonk
038sclin221105T180256ZMama Fun
024Factor221105T154830Zchunes
nanSequences221105T135411ZThe Thon
816Nibbles221105T143833ZDominic
048Ruby221105T142844Ztouka
058JavaScript Node.js221105T140346ZArnauld
046Python221105T135155ZThe Thon
015Charcoal221105T140248ZNeil
006Husk221105T140115ZDominic

AWK, 82 bytes

@load"ordchr"
{for(t=i=0;i++<NF;)t+=ord($i);s[++j]=t/--i}END{asort(s);print s[NR]}

Attempt This Online!

Uiua, 15 bytes

/↥∵(÷⊃⧻/+-@\0⊔)

Try it!

/↥∵(÷⊃⧻/+-@\0⊔)
  ∵(          )  # map over input
             ⊔   # unbox a string
         -@\0    # subtract null character
    ÷⊃⧻/+        # mean
/↥               # max

Zsh, 63 bytes

for w;c=&&for a (${(s::)w})((c+=#a,o=1.*c/$#w,m=o>m?o:m))
<<<$m

Try it online!  65b 74b

for w; implicitly iterates over the arguments ($@).
for a (${(s::)w}) iterates over each letter in word w.
c accumulates the ascii sum
o is the average ord for w
m is the maximum o found

Edit: Saved 6 bytes by chaining 3 math expressions in the parentheses((,,))!

Nekomata, 4 bytes

eᵐµṀ

Attempt This Online!

eᵐµṀ
e       Ord
 ᵐ      Map
  µ     Mean
   Ṁ    Maximum

Thunno 2 G, 2 bytes

€m

Try it online!

Take the mean of ach string in the (implicit) input list (this automatically converts to codepoints). Then, take the Greatest item.

Octave, 18 bytes

@(x)max(mean(+x'))

Try it online!

Arturo, 48 22 bytes

$=>[map&=>average|max]

Try it

Lua, 94 bytes

I tried two approaches here, both of which ended up having the same byte count.

List of Arguments

m=0 for i=1,#arg do n=0s=arg[i]s:gsub('.',load'n=s.byte(...)+n')m=math.max(m,n/#s)end print(m)

Try it online!

Space Delimited String

m=0(...):gsub('%S+',load'n=0s=...s:gsub(".",load"n=s.byte(...)+n")m=math.max(m,n/#s)')print(m)

Try it online!

Stax, 10 9 bytes

é)u6║"⌂w╙

Run and debug it

This is a PackedStax program, which unpacks to the following:

{:V}kTlE:_

Run and debug it

Explanation (unpacked)

{  }k      # map the following over all the values in the input
 :V        # get the mean of the array
     T     # Get the maximum of this map
      l    # The output is a fraction, so it must be listified
       E   # Explode this list onto the stack
        :_ # Float division

CJam, 19 14 bytes

{:d_:+\,/}%$W=

Try it online!

A function which takes an input as an array. Link includes test cases.

Explanation

{:d_:+\,/}%$W= # function which takes an array as input
{        }%    # for each value in the input array...
 :d            # short map `:` the operator `d` to convert into an array of `d`oubles
   _:+         # duplicate and sum
      \        # swap
       ,       # get the length of the array
        /      # divide, giving the average
           $   # perform a $ort on the resulting array
            W= # and get index `W` (shorthand for `-1`), which is the last value of the sort, or the max

><>, 36 35 bytes

000\&l3-,:{:@)?$&0(?n1[!
"(?\+:i:"!

Try it online!

Words are separated by spaces (or characters less than space like newline). This uses the length of the stack rather than a counter to get the length of the word.

><>, 65 45 44 40 bytes

000i:"!"(?v+$1+$20.
$~$0(?n00.>@$,:{:@(?

Try it online!

Takes input as a space separated string.

Python 3, 71 70 bytes

lambda l:max(map(lambda s:mean(map(ord,s)),l))
from statistics import*

Try it online!

-1 thanks to The Thonnu

J-uby, 43 38 36 30 bytes

-5 bytes thanks to Steffan

Originally based on TKirishima's Ruby answer.

:*&:/%[:bytes|:sum,:+@|Q]|:max

Attempt This Online!

Explanation

:* & :/ % [ :bytes | :sum, :+@ | Q ] | :max

:* &                                         # Map with...
            :bytes | :sum                    #   Sum of bytes
     :/ % [              ,         ]         #   Divided by
                           :+@ | Q           #   Length converted to float
                                     | :max  # Get max

Raku, 27 bytes

*».&{.ords.sum/.chars}.max

Try it online!

Edit: as per advice from @Steffan

C++ (gcc), 166 120 bytes

-46 thanks to the combined efforts of @ceilingcat and @jdt.

#import<bits/stdc++.h>
auto f(auto a,float*r){*r=0;for(char*t:a){int u=0,s=0;for(;*t;u+=*t++)s++;*r=fmax(*r,(0.+u)/s);}}

Try it online!

Original Answer:

Attempting to apply general-purpose programming to code golf doesn't seem to work out well.

#import<bits/stdc++.h>
auto g(char*a){int t=0,s=0;for(a--;*++a;s++,t+=*a);return(0.0+t)/s;}auto f(std::list<char*>a){float m=0;for(char*t:a)m=m>g(t)?m:g(t);return m;}

Try it online!

Ungolfed:

// Gets the average ord value of a string
auto g(char* a) {
    int t=0, s=0;             // Running total and size 

    for (a--;*++a;s++,t+=*a); // Loop until a equals 0 and add a onto the running total
    
    return (0.0+t) / s;       // Cast to float by adding 0.0 and divide the total by the size.
}

// "Main" function
auto f(std::list<char*> a) {
    float m = 0;           // Maximum value
    
    for (char* t : a) {    // Loop through all the strings in the list
        m = m>g(t)?m:g(t); // If m is greater than the output from the function, return m. Otherwise, return the output of the function
    }
    
    return m;              // m is the final result that we want
}

T-SQL, 125 bytes

WITH C as(SELECT len(x)m,0b,*FROM @
UNION ALL SELECT m-1,b+ascii(right(x,m)),x
FROM C WHERE
m>0)SELECT max(b*1./len(x))FROM c

Try it online

MATLAB, 39 31 bytes

@(s)max(cellfun(@(x)mean(x),s))

Matlab unfortunately doesn't convert strings ("") directly to ASCII values using the double function, and if converted to char type then a string array will be padded with spaces to make a proper matrix. As a result, the input is a cellstr type, which needs to be looped over using the cellfun function with an anonymous function that takes the average of the unicode values of the strings (''). The output is then the maximum of those values.

Try it online!

edit: -8 bytes thanks to Guiseppe

C (clang), 87 86 84 81 bytes.

v;*p;f(**t,float*r){for(*r=0;p=*t;*r=fmax(*r,v*1./(p-*t++)))for(v=0;*p;)v+=*p++;}

Try it online!

PHP 8.x, 75 73 bytes

Creates an anonymous function that returns the expect values, hopefully.

fn($x)=>max(array_map(fn($z)=>array_sum(unpack('C*',$z))/strlen($z),$x));

-2 bytes thanks to Sʨɠɠan.

How does it work?

This uses the unpack('C*', ...) function to convert all characters into an unsigned char (0-255).
This assumes all characters are part of the ASCII table.

Then it calculates the average using array_sum([...])/strlen([...]).
The function array_sum() takes an array and returns the sum of all elements, and strlen() returns the length of the string.

The function max() takes the array with the averages and returns the highest value from it.

Anonymous functions implicitly return values.

Example usage

You need to assign this to a variable, or call with call_user_func() or call_user_func_array():

<?php
$fn = fn($x)=>max(array_map(fn($z)=>array_sum(unpack('C*',$z))/strlen($z),$x));

// Should output: float(110.4)
var_dump($fn(['hello', 'world', 'bye']));

You can try this here (with test examples): https://onlinephp.io/c/2a424

><>, 80 51 48 bytes

0>0001.
$i:"!"(?v+$1+
(@:{:,$&/
v?(0&~$?/.02
\n;

Animated Version

Requires a extra space at the end of the input. Also assumes no 2 spaces in a row. (no 0 length words). Anything with ORD of 32 or lower is considered white-space.

Explanation

enter image description here

Top row: Push 3 0s on to the stack. The first is the current best ORD, the second is the length of the current word, and the last is the sum of the ord values of the current word. 01. is a jump to the next row.

The second row sums a word. If a character is less than "!" (char value 33) go down. Otherwise sum the word and increment the length. `$1+

In the third row, we fist push the last value to the register & . We use this to later check if this was the end of the string. Then we divide by the length to get the new ORD value. Then we use the :{:@ trick to copy the stack if it has only 2 elements (which is always the case) from the stack and compare them. If the new one is better we swap the stack with $. In either case we delete the top item.

Lastly, we take the value of the register and check if it is negative, &0(?. If so, we print the maximum ord and exit. If not, we jump back to 00. To get the correct direction we use the 00!.| trick.

Japt -h, 9 bytes

Takes input as an array of character arrays.

®xc /ZlÃñ

Try it

®xc /ZlÃñ     :Implicit input of 2D array of characters
®             :Map each sub-array Z
 x            :  Reduce by addition of
  c           :    Codepoints
    /         :  Divide by
     Zl       :    Length of Z
       Ã      :End map
        ñ     :Sort
              :Implicit output of last element

Go, 132 108 bytes

func f(S[]string)(m int){for a,s:=range S{a=0
for _,r:=range s{a+=int(r)}
if a=a*10/len(s);a>m{m=a}}
return}

Attempt This Online!

BQN, 13 12 bytes

-1 byte inspired by Aiden Chow's APL answer

⌈´+´∘-⟜@¨÷≠¨

Anonymous tacit function; takes a list of strings and returns a float. Try it at BQN online!

Explanation

⌈´+´∘-⟜@¨÷≠¨
          ≠¨  Length of each string
         ÷    Divide the following by the above:
  +´∘           Sum of
     -⟜@       Subtract null character from (each character in)
        ¨       Each string
⌈             Get the maximum of the resulting list of averages

APL(Dyalog Unicode), 14 13 bytes SBCS

-1 bytes thanks to Adám

⌈/+⌿∘⎕UCS¨÷≢¨

Try it on APLgolf!

A tacit function which finds the maximum ord. Originally wrote a dfn, but I tried random stuff to convert it to tacit and it somehow worked out.

⌈/+⌿∘⎕UCS¨÷≢¨
          ¨              ⍝  for each element in the input...
     ⎕UCS               ⍝  convert the characters to their ascii values...
  +⌿∘                   ⍝  and sum the resulting ascii values...
           ÷             ⍝  divided by...
            ≢¨           ⍝  the length of each element...
⌈/                       ⍝  and take the maximum of that

J, 18 bytes

[:>./(1#.3&u:%#)&>

Accepts list of boxed strings

Attempt This Online!

[:>./(1#.3&u:%#)&>
[:                  NB. cap, [: f g y -> f (g y)
                &>  NB. for each input item, result will be unboxed
     (         )    NB. monadic fork
              #     NB. length
         3&u:       NB. convert input to list of char codes
             %      NB. vectorized division
      1#.           NB. sum the result to compute average
  >./               NB. max item

Java 8, 81 79 56 bytes

a->a.mapToDouble(s->s.chars().average().orElse(0)).max()

Input as a Stream<String> and output as an OptionalDouble.

Try it online.

Explanation:

a->                  // Method with String-Stream parameter & OptionalDouble return-type
   a.map             //  Map over the input-Stream
        ToDouble(s-> //  and convert them to a Stream of Doubles
      s.chars()      //   Convert the String to an IntStream of its codepoint integers
       .average()    //   Then take the average of that IntStream (as OptionalDouble)
       .orElse(0))   //   And convert the OptionalDouble to double
                     //   (`.orElse(0)` is shorter than `.getAsDouble()`)
    .max()           //  After the map: leave the maximum (again as OptionalDouble)

MathGolf, 4 bytes

$m▓╙

Input as a list of lists of characters.

Try it online.

Explanation:

$     # Get the codepoint of each inner-most character of the (implicit) input-list
 m    # Map over each list of integers:
  ▓   #  Pop and push the average of the list
   ╙  # After the map: pop and push the maximum
      # (after which the entire stack is output implicitly as result)

Excel (ms365), 70 bytes

enter image description here

Formula in F1:

=MAX(MAP(A1:C1,LAMBDA(a,SUM(CODE(MID(a,SEQUENCE(LEN(a)),1)))/LEN(a))))

Julia, 34 bytes

!a=max(sum.(Int,a)./length.(a)...)

Attempt This Online!

K (ngn/k), 18 11 bytes

|/{+/x%#x}'

Try it online!

Massive -7 bytes golf thanks to Steffan!

Damn everyone is answering quick. Anyways here's my solution. Takes input as a list of strings.

Explanation:

|/{+/x%#x}'  Main function. Takes implicit input
          '  For each string in the input...
  {      }   Execute a function that...
   +/x       Takes sum of every character in the string
      %      And divide it by
       #x    The length of the string
|/           Get the maximum value

Knight (v2), 56 bytes

;=mF;W=pP;=s!=i~1;W>Lp=i+1i=s+*10A Gp iTs&<m=t/sLp=m tOm

Try it online!

Because Knight doesn't support floating point values, it outputs the maximum average ord multiplied by \$10\$, as allowed by the rules:

It may be rounded to any number (\$\ge1\$) of decimal places. If your language does not support floating points, you may output the average multiplied by 10.

Wren, 68 bytes

Fn.new{|x|x.reduce(0){|y,z|y.max(z.bytes.reduce{|a,b|a+b}/z.count)}}

Try it

Pip, 12 bytes

M:$+A*_/#_Mg

Try It Online!

05AB1E, 10 9 4 bytes

ÇÅAà

-5 thanks to Sʨɠɠan

Try it online!

Explained:

ÇÅAà  # Implicit input as a list
      # Implicit map over the input:
Ç     #   Get the ord of each character
 ÅA   #   Get the average of the ords
   à  # Get the maximum value

Jelly, 4 bytes

OÆmṀ

Try it online!

Fig, \$6\log_{256}(96)\approx\$ 4.939 bytes

]KemMC

Try it online!

]KemMC
     C - Charcodes
  emM  - Mean of each
 K     - Sort
]      - Last

Vyxal G, 3 bytes

Cvṁ

Try it Online!

Mathematica, 29 bytes

Max[Mean/@ToCharacterCode@#]&

View it on Wolfram Cloud!

Pyth, 7 bytes

eSm.OCM

Test suite

Explanation:
eSm.OCM   | Full program
eSm.OCMdQ | with implicit variables
----------+-------------------------------
  m     Q | For each word in the input,
     CMd  |  Get the ord of each character
   .O     |  Get the average
eS        | Get the max

R, 38 bytes

\(x)max(sapply(Map(utf8ToInt,x),mean))

Attempt This Online!

               Map(utf8ToInt,x)        # for every string in the input, store the vector of its codepoints in a list
        sapply(                ,mean)  # apply mean to each of the list elements and return a vector
\(x)max(                             ) # take max

sclin, 38 bytes

"dup S>c0\+ fold rev len /"map0\| fold

Try it here! This might be a good case for adding sum/prod/min/max functions to sclin, the fold construct is alright but it could be better.

For testing purposes:

["hello" "world" "bye"] ; 30N>d n>o
"dup S>c0\+ fold rev len /"map0\| fold

Explanation

Prettified code:

( dup S>c 0 \+ fold rev len / ) map 0 \| fold

Assuming input list xs.

Factor, 24 bytes

[ 0 [ mean max ] foldl ]

Attempt This Online!

Just fold with the max of the mean.

Sequences, \$9 \log_{256}(96) \approx 7.41\$ bytes

[$v$aH]gM

Explanation

[$v$aH]gM  // Implicit list of string input
[     ]    // Loop through the input list:
 $v$       //   Get a list of ords of each character
    aH     //   Get the average and append to `g`
       g   // Push the list `g`
        M  // Get the maximum value
           // Implicit output

Screenshot

Nibbles, 8 bytes (16 nibbles)

`/.$/*+.$o$10,$]

Nibbles works only in integers, so this returns the maximum average ord multiplied by 10 (and rounded-down to a whole number).

`/.$/*+.$o$10,$]
  .$              # map over each input string
       .$         #   map over each character
         o$       #     getting it's ord 
      +           #   sum them all
     *     10     #   multiply by 10
    /             #   and divide by    
             ,$   #   the length of the string
`/                # finally, fold over the list
               ]  #   getting the max of each pair

enter image description here

Ruby, 48 bytes

->l{l.map{_1.chars.sum(&:ord)/_1.size.to_f}.max}

As the division of two integers in ruby gives an integer, and what was expected was a float, it's long :/
And .fdiv is one byte longer

Attempt This Online!

JavaScript (Node.js), 58 bytes

a=>Math.max(...a.map(s=>eval(Buffer(s).join`+`)/s.length))

Try it online!

Python, 46 bytes

lambda l:max(sum(map(ord,s))/len(s)for s in l)

Attempt This Online!

Unfortunately, the only built-in mean function Python has is in the statistics module, and that's too expensive to import.

Charcoal, 15 bytes

WS⊞υ∕ΣEι℅κLιI⌈υ

Try it online! Link is to verbose version of code. Takes input as a list of newline-terminated strings. Explanation:

WS

Repeat until the end of the list is reached...

⊞υ∕ΣEι℅κLι

... take the ordinals of the characters in the string, and divide their sum by the string's length.

I⌈υ

Output the maximum average.

Husk, 6 bytes

▲moAmc

Try it online!

Outputs the highest average ord value as an exact fraction.

▲moAmc
 mo    # map 2 functions over each element of input
    mc #   get ord values of each character
   A   #   get the average of those
▲      # output the maximum.