Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save christopher-besch/5b5e3af95ea89b2c787502eae19ca1fb to your computer and use it in GitHub Desktop.
Save christopher-besch/5b5e3af95ea89b2c787502eae19ca1fb to your computer and use it in GitHub Desktop.
get a list with every video that is longer than or as long as every video coming after it
text = """
1
13:07
Now playing
Introducing the GAME ENGINE series!
The Cherno
2
16:23
Now playing
What is a GAME ENGINE?
The Cherno
3
26:33
Now playing
DESIGNING our GAME ENGINE
The Cherno
4
24:39
Now playing
Project Setup | Game Engine Series
The Cherno
5
24:45
Now playing
Entry Point | Game Engine Series
The Cherno
6
30:05
Now playing
Logging | Game Engine Series
The Cherno
7
31:48
Now playing
Premake | Game Engine Series
The Cherno
8
16:12
Now playing
Planning the Event System | Game Engine series
The Cherno
9
35:40
Now playing
Event System | Game Engine series
The Cherno
10
10:22
Now playing
Precompiled Headers | Game Engine series
The Cherno
11
29:20
Now playing
Window Abstraction and GLFW | Game Engine series
The Cherno
12
23:37
Now playing
Window Events | Game Engine series
The Cherno
13
22:59
Now playing
Layers | Game Engine series
The Cherno
14
19:39
Now playing
Modern OpenGL (Glad) | Game Engine series
The Cherno
15
27:57
Now playing
ImGui | Game Engine series
The Cherno
16
23:03
Now playing
ImGui Events | Game Engine series
The Cherno
17
27:03
Now playing
GitHub and Hazel | Game Engine series
The Cherno
18
24:03
Now playing
Pull Requests | Game Engine series
The Cherno
19
25:41
Now playing
Input Polling | Game Engine series
The Cherno
20
23:50
Now playing
Key and Mouse Codes | Game Engine series
The Cherno
21
19:28
Now playing
Maths | Game Engine series
The Cherno
22
31:34
Now playing
ImGui Docking and Viewports | Game Engine series
The Cherno
23
28:42
Now playing
Introduction to Rendering | Game Engine series
The Cherno
24
27:53
Now playing
Rendering Architecture | Game Engine series
The Cherno
25
24:59
Now playing
Rendering and Maintenance | Game Engine series
The Cherno
26
22:51
Now playing
Static Libraries and ZERO Warnings | Game Engine series
The Cherno
27
27:03
Now playing
Rendering Context | Game Engine series
The Cherno
28
28:33
Now playing
Our First Triangle! | Game Engine series
The Cherno
29
42:47
Now playing
OpenGL Shaders | Game Engine series
The Cherno
30
47:17
Now playing
Renderer API Abstraction | Game Engine series
The Cherno
31
49:16
Now playing
Vertex Buffer Layouts | Game Engine series
The Cherno
32
42:42
Now playing
Vertex Arrays | Game Engine series
The Cherno
33
36:30
Now playing
Renderer Flow and Submission | Game Engine series
The Cherno
34
38:54
Now playing
CAMERAS and How They Work | Game Engine series
The Cherno
35
38:28
Now playing
Creating an Orthographic Camera | Game Engine series
The Cherno
36
22:16
Now playing
Moving to Sandbox | Game Engine series
The Cherno
37
28:06
Now playing
TIMESTEPS and DELTA TIME | Game Engine series
The Cherno
38
25:03
Now playing
Transforms | Game Engine series
The Cherno
39
32:05
Now playing
Material Systems | Game Engine series
The Cherno
40
27:19
Now playing
Shader Abstraction and Uniforms | Game Engine series
The Cherno
41
24:55
Now playing
Refs, Scopes and Smart Pointers | Game Engine series
The Cherno
42
51:48
Now playing
TEXTURES | Game Engine series
The Cherno
43
19:21
Now playing
BLENDING | Game Engine series
The Cherno
44
39:11
Now playing
Shader Asset Files | Game Engine series
The Cherno
45
41:23
Now playing
Shader Library | Game Engine series
The Cherno
46
39:30
Now playing
How to Build a 2D Renderer | Game Engine series
The Cherno
47
35:50
Now playing
Camera Controllers | Game Engine series
The Cherno
48
30:53
Now playing
Resizing | Game Engine series
The Cherno
49
24:42
Now playing
Maintenance | Game Engine series
The Cherno
50
29:14
Now playing
Preparing for 2D Rendering | Game Engine series
The Cherno
51
34:55
Now playing
Starting our 2D Renderer | Game Engine series
The Cherno
52
15:50
Now playing
2D Renderer Transforms | Game Engine series
The Cherno
53
21:35
Now playing
2D Renderer Textures | Game Engine series
The Cherno
54
28:07
Now playing
Single Shader 2D Renderer | Game Engine series
The Cherno
55
24:54
Now playing
Intro to Profiling | Game Engine series
The Cherno
56
28:46
Now playing
Visual Profiling | Game Engine series
The Cherno
57
37:36
Now playing
Instrumentation | Game Engine series
The Cherno
58
27:14
Now playing
Improving our 2D Rendering API | Game Engine series
The Cherno
59
32:21
Now playing
How I Made a Game in an Hour Using Hazel
The Cherno
60
20:57
Now playing
Hazel 2020 | Game Engine series
The Cherno
61
35:49
Now playing
BATCH RENDERING | Game Engine series
The Cherno
62
46:30
Now playing
Batch Rendering Textures (+ Debugging!) // Game Engine series
The Cherno
63
16:43
Now playing
Drawing Rotated Quads // Game Engine series
The Cherno
64
34:48
Now playing
Renderer Stats and Batch Improvements // Game Engine series
The Cherno
65
20:45
Now playing
Testing Hazel's Performance! // Game Engine series
The Cherno
66
25:09
Now playing
Let's Make Something in Hazel! // Game Engine series
The Cherno
67
23:59
Now playing
How Sprite Sheets/Texture Atlases Work // Game Engine series
The Cherno
68
26:32
Now playing
SubTextures - Creating a Sprite Sheet API // Game Engine series
The Cherno
69
25:19
Now playing
Creating a Map of Tiles // Game Engine series
The Cherno
70
29:26
Now playing
Next Steps + Dockspace | Game Engine series
The Cherno
71
45:22
Now playing
Framebuffers | Game Engine series
The Cherno
72
19:38
Now playing
Making a New C++ Project in Hazel | Game Engine series
The Cherno
73
23:58
Now playing
Scene Viewport | Game Engine series
The Cherno
74
39:03
Now playing
Code Review + ImGui Layer Events | Game Engine series
The Cherno
75
35:59
Now playing
Where to go next + Code Review | Game Engine series
The Cherno
76
43:05
Now playing
Entity Component System | Game Engine series
The Cherno
77
31:10
Now playing
Intro to EnTT (ECS) | Game Engine series
The Cherno
"""
class Video:
def __init__(self, number, length_str):
self.number = int(number.strip())
minutes = int(length_str.strip().split(":")[0])
seconds = int(length_str.strip().split(":")[1])
self.length = minutes * 60 + seconds
def __repr__(self):
return f"{self.number}\t{self.length}s"
text = text.split("\n")
videos = []
for idx, i in enumerate(text):
if ":" in i:
videos.append(Video(text[idx-1], text[idx]))
bests = []
start_idx = 0
while start_idx < len(videos):
current_best = Video("-1", "0:-1")
for i in videos[start_idx:]:
if i.length > current_best.length:
current_best = i
start_idx = current_best.number
bests.append(current_best)
print(current_best)
@christopher-besch
Copy link
Author

What is this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment