The Olympic Games Paris 2024 are open

Paris2024

Paris2024
inc(i,j,x,y) = round(Int,hypot(i-x, j-y)) == 6
ch(x) = x ? "#" : " "
n = 0:44
m = @. inc(n,n',16,8) | inc(n,n',16,22) | inc(n,n',16,36) | inc(n,n',22,15) | inc(n,n',22,29)
foreach(println, ["\n"; " "^18 * "Paris 2024"; join.(eachrow(ch.(m)))])

PS:
Celine Dion, she was magnificent!

16 Likes

Nice - I like the brevity - Olympic golfing?!

Here’s your next plotting challenge:

:slight_smile:

10 Likes

Could do it, but with considerable pain in calculating all those circles intersections, plus arc segments, plus …

2 Likes

Plots_Olympic_rings_color

Paris 2024
using Plots; gr(dpi=600)
import Plots: partialcircle as pc

r , f, C = 6, 255, [(8,16), (22,16), (36,16), (15,22), (29,22)]
cls = [RGB(0,129/f,200/f), :black, RGB(238/f,51/f,78/f), RGB(252/f,177/f,49/f), RGB(0,166/f,81/f)]
p = plot(frame=:none, aspect_ratio=1, yflip=true, title="Paris 2024",titlefontsize=24)
foreach(i->plot!(map(x->x .+ C[i], pc(0, 2π, 100, r)), c=cls[i], lw=15, label=false), 1:5)
foreach(i->plot!(map(x->x .+ C[i], pc(-0.2, 0.2, 100, r)), c=cls[i], lw=15, label=false), 1:2)
foreach(i->plot!(map(x->x .+ C[i], pc(1.62, 1.9, 100, r)), c=cls[i], lw=15, label=false), 2:3)
p
14 Likes

Indeed, that would be a pain. I cheated by tilting each ring:

12 Likes

No pain, just a few quick strokes of paint!
(code posted above)

1 Like

The Paris 2024 Olympic medals by country, sorted in 3 different ways:

using TableScraper, DataFrames

url =  "https://www.bbc.com/sport/olympics/paris-2024/medals"
tbl = scrape_tables(url)
header = tbl[1].columnnames
rows = tbl[1].rows

df = DataFrame(header .=> eachrow(reduce(hcat, rows)))
rename!(df, :TotalTotal => :TOTAL_MEDALS)
df[!, 3:6] = parse.(Int64, df[:, 3:6])
transform!(df, [:GGold, :SSilver, :BBronze] => ((g,s,b) -> (3*g + 2*s + b)) => :TOTAL_POINTS)

sort(df, [:GGold, :SSilver, :BBronze], rev=true)
sort(df, :TOTAL_MEDALS, rev=true)
sort(df, :TOTAL_POINTS, rev=true)
8 Likes