Tables, Functions, Sprocs
In order to load some scripts into my database in the correct order I need to load tables first (t_), then functions (fn_), then stored procedures (sp_). The order of the t_ lines and the order of the sp_ lines should also match. Reorder the lines so they will load correctly.
Start file
sp_zebra
t_orangutan
t_buffalo
sp_walrus
fn_weight
fn_food
sp_lion
t_lion
sp_buffalo
t_walrus
fn_sleep
t_zebra
sp_orangutan
End file
t_buffalo
t_lion
t_orangutan
t_walrus
t_zebra
fn_food
fn_sleep
fn_weight
sp_buffalo
sp_lion
sp_orangutan
sp_walrus
sp_zebra
View Diff
1,2d0
< sp_zebra
< t_orangutan
4,7d1
< sp_walrus
< fn_weight
< fn_food
< sp_lion
9c3
< sp_buffalo
---
> t_orangutan
11d4
< fn_sleep
12a6,10
> fn_food
> fn_sleep
> fn_weight
> sp_buffalo
> sp_lion
13a12,13
> sp_walrus
> sp_zebra
Solutions
The best way to learn is to practice. Below, you will find some of the solutions other golfers have entered. To unlock higher ranked solutions, submit your own entry which does as well or better than the solutions you can currently see - climb the ladder!
Check out these helpful resources to improve your Vim skills... Game on.
Unlock 46 remaining solutions by signing in and submitting your own entry