Ordered words: Difference between revisions

m (→‎{{header|Ring}}: needs improvement)
Line 3,546:
 
=={{header|Ring}}==
{{Improve|Ring|Task is find the '''longest''' ordered words, not find ordered words longer than 3 characters}}
<lang ring>
load "stdlib.ring"
 
 
cStr = read("unixdict.txt")
wordList = str2list(cStr)
sum = 0
sortList = []
 
see "working..." + nl + nl
Line 3,566 ⟶ 3,567:
ok
next
if num = len and len(wordList[n]) > 3
sum = sum + 1
see "" + sum + ". " + add(sortList,[wordList[n] + nl,len])
ok
next
 
sortList = sort(sortList,2)
sortList = reverse(sortList)
 
len = sortList[1][2]
 
for n = 1 to len(sortList)
if sortList[n][2] = len
see sortList[n][1] + nl
ok
next
 
see nl + "done..." + nl
</lang>
Line 3,577 ⟶ 3,590:
working...
 
almost
1. abel
biopsy
2. abet
3. abort
4. aden
5. adept
6. adopt
7. aegis
8. ahoy
9. ainu
10. airy
11. almost
12. alps
13. amort
14. amos
15. arty
16. befit
17. begin
18. below
19. belt
20. bent
21. benz
22. bert
23. best
24. bevy
25. bhoy
26. biopsy
27. blot
28. blow
29. boxy
30. ceil
31. cent
32. chin
33. chip
34. chit
35. chop
36. chou
37. chow
38. city
39. clot
40. cloy
41. copy
42. cost
43. cosy
44. crux
45. cruz
46. deft
47. defy
48. deity
49. demo
50. dent
51. deny
52. dewy
53. dint
54. dirt
55. dirty
56. emory
57. empty
58. enos
59. envy
60. film
61. filmy
62. first
63. fist
64. flop
65. flow
66. flux
67. fort
68. forty
69. foxy
70. ghost
71. gilt
72. gimpy
73. gino
74. gist
75. glory
76. glow
77. gory
78. hilt
79. hint
80. host
81. klux
82. knot
83. know
84. knox
85. lost
86. mort
87. most
 
done...
2,468

edits