Skip to content

Commit 5af5a91

Browse files
committed
Generated Sample Programs website automatically
on-behalf-of: @TheRenegadeCoder <jeremy.grifski@therenegadecoder.com>
1 parent 34931d5 commit 5af5a91

File tree

5 files changed

+105
-15
lines changed

5 files changed

+105
-15
lines changed

docs/index.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,6 @@ layout: default
55
title: Sample Programs in Every Language
66
---
77

8-
Welcome to Sample Programs in Every Language, a collection of code snippets in as many languages as possible. Thanks for taking an interest in our collection which currently contains 1495 articles written by 281 authors.
8+
Welcome to Sample Programs in Every Language, a collection of code snippets in as many languages as possible. Thanks for taking an interest in our collection which currently contains 1496 articles written by 281 authors.
99

1010
If you'd like to contribute to this growing collection, check out our [contributing document](https://github.com/TheRenegadeCoder/sample-programs/blob/master/.github/CONTRIBUTING.md) for more information. In addition, you can explore our documentation which is organized by [project](/projects) and by [language](/languages). If you don't find what you're look for, check out our list of related [open-source projects](/related). Finally, if code isn't your thing but you'd still like to help, there are plenty of other ways to [support the project](https://therenegadecoder.com/updates/5-ways-you-can-support-the-renegade-coder/).

docs/languages/index.md

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ layout: default
66
title: Programming Languages
77
---
88

9-
Welcome to the Languages page! Here, you'll find a list of all of the languages represented in the collection. At this time, there are 156 languages, of which 155 are tested, 1 is untestable, and 1301 code snippets.
9+
Welcome to the Languages page! Here, you'll find a list of all of the languages represented in the collection. At this time, there are 156 languages, of which 155 are tested, 1 is untestable, and 1302 code snippets.
1010

1111
## Language Breakdown
1212

@@ -18,7 +18,7 @@ Here are the percentages for each language in the collection:
1818

1919
<tr>
2020
<td class="right nowrap">Algol68</td>
21-
<td class="right">7.31%</td>
21+
<td class="right">7.30%</td>
2222
<td class="bar-graph"><div style="width: 100.00%; background-color: #AF425E;"></div></td>
2323
</tr>
2424

@@ -30,7 +30,7 @@ Here are the percentages for each language in the collection:
3030

3131
<tr>
3232
<td class="right nowrap">Euphoria</td>
33-
<td class="right">6.39%</td>
33+
<td class="right">6.38%</td>
3434
<td class="bar-graph"><div style="width: 87.42%; background-color: #FF790B;"></div></td>
3535
</tr>
3636

@@ -48,13 +48,13 @@ Here are the percentages for each language in the collection:
4848

4949
<tr>
5050
<td class="right nowrap">Rust</td>
51-
<td class="right">4.56%</td>
51+
<td class="right">4.55%</td>
5252
<td class="bar-graph"><div style="width: 62.35%; background-color: #DEA584;"></div></td>
5353
</tr>
5454

5555
<tr>
5656
<td class="right nowrap">C</td>
57-
<td class="right">4.52%</td>
57+
<td class="right">4.51%</td>
5858
<td class="bar-graph"><div style="width: 61.81%; background-color: #555555;"></div></td>
5959
</tr>
6060

@@ -126,8 +126,8 @@ Here are the percentages for each language in the collection:
126126

127127
<tr>
128128
<td class="right nowrap">Tcl</td>
129-
<td class="right">1.47%</td>
130-
<td class="bar-graph"><div style="width: 20.06%; background-color: #E4CC98;"></div></td>
129+
<td class="right">1.53%</td>
130+
<td class="bar-graph"><div style="width: 20.92%; background-color: #E4CC98;"></div></td>
131131
</tr>
132132

133133
<tr>
@@ -144,7 +144,7 @@ Here are the percentages for each language in the collection:
144144

145145
<tr>
146146
<td class="right nowrap">Objective C</td>
147-
<td class="right">1.25%</td>
147+
<td class="right">1.24%</td>
148148
<td class="bar-graph"><div style="width: 17.05%; background-color: #438EFF;"></div></td>
149149
</tr>
150150

@@ -1263,9 +1263,9 @@ The 'S' collection contains 10 languages, of which 10 are tested, and 41 code sn
12631263

12641264
### T
12651265

1266-
The 'T' collection contains 5 languages, of which 5 are tested, and 61 code snippets.
1266+
The 'T' collection contains 5 languages, of which 5 are tested, and 62 code snippets.
12671267

1268-
- [Tcl](https://sampleprograms.io/languages/tcl) (20 code snippets)
1268+
- [Tcl](https://sampleprograms.io/languages/tcl) (21 code snippets)
12691269
- [Terra](https://sampleprograms.io/languages/terra) (2 code snippets)
12701270
- [Tex](https://sampleprograms.io/languages/tex) (3 code snippets)
12711271
- [Ti Basic](https://sampleprograms.io/languages/ti-basic) (13 code snippets)

docs/languages/tcl/index.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ No 'Description' section available. [Please consider contributing](https://githu
2626

2727
## Articles
2828

29-
There are 20 articles:
29+
There are 21 articles:
3030

3131
- [Baklava in Tcl](https://sampleprograms.io/projects/baklava/tcl)
3232
- [Base64 Encode Decode in Tcl](https://sampleprograms.io/projects/base64-encode-decode/tcl)
@@ -47,4 +47,5 @@ There are 20 articles:
4747
- [Insertion Sort in Tcl](https://sampleprograms.io/projects/insertion-sort/tcl)
4848
- [Josephus Problem in Tcl](https://sampleprograms.io/projects/josephus-problem/tcl)
4949
- [Linear Search in Tcl](https://sampleprograms.io/projects/linear-search/tcl)
50-
- [Longest Word in Tcl](https://sampleprograms.io/projects/longest-word/tcl)
50+
- [Longest Word in Tcl](https://sampleprograms.io/projects/longest-word/tcl)
51+
- [Maximum Subarray in Tcl](https://sampleprograms.io/projects/maximum-subarray/tcl)

docs/projects/maximum-subarray/index.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
date: 2020-10-14
33
featured-image: maximum-subarray-in-every-language.jpg
4-
last-modified: 2025-09-07
4+
last-modified: 2025-10-09
55
layout: default
66
tags:
77
- maximum-subarray
@@ -86,7 +86,7 @@ Usage: Please provide a list of integers in the format: "1, 2, 3, 4, 5"
8686

8787
## Articles
8888

89-
There are 14 articles:
89+
There are 15 articles:
9090

9191
- [Maximum Subarray in Algol68](https://sampleprograms.io/projects/maximum-subarray/algol68)
9292
- [Maximum Subarray in Awk](https://sampleprograms.io/projects/maximum-subarray/awk)
@@ -102,6 +102,7 @@ There are 14 articles:
102102
- [Maximum Subarray in Powershell](https://sampleprograms.io/projects/maximum-subarray/powershell)
103103
- [Maximum Subarray in Python](https://sampleprograms.io/projects/maximum-subarray/python)
104104
- [Maximum Subarray in Rust](https://sampleprograms.io/projects/maximum-subarray/rust)
105+
- [Maximum Subarray in Tcl](https://sampleprograms.io/projects/maximum-subarray/tcl)
105106

106107
***
107108

Lines changed: 88 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,88 @@
1+
---
2+
authors:
3+
- "\u0218tefan-Iulian Alecu"
4+
date: 2025-10-09
5+
featured-image: maximum-subarray-in-every-language.jpg
6+
last-modified: 2025-10-09
7+
layout: default
8+
tags:
9+
- maximum-subarray
10+
- tcl
11+
title: Maximum Subarray in Tcl
12+
---
13+
14+
<!--
15+
AUTO-GENERATED -- PLEASE DO NOT EDIT!
16+
17+
Instead, please edit the following:
18+
19+
- sources/programs/maximum-subarray/tcl/how-to-implement-the-solution.md
20+
- sources/programs/maximum-subarray/tcl/how-to-run-the-solution.md
21+
22+
See .github/CONTRIBUTING.md for further details.
23+
-->
24+
25+
Welcome to the [Maximum Subarray](https://sampleprograms.io/projects/maximum-subarray) in [Tcl](https://sampleprograms.io/languages/tcl) page! Here, you'll find the source code for this program as well as a description of how the program works.
26+
27+
## Current Solution
28+
29+
{% raw %}
30+
31+
```tcl
32+
proc usage {} {
33+
puts stderr {Usage: Please provide a list of integers in the format: "1, 2, 3, 4, 5"}
34+
exit 1
35+
}
36+
37+
proc parseList {s} {
38+
set tokens [split [string trim $s] ","]
39+
if {[llength $tokens] < 1} { usage }
40+
41+
set result {}
42+
43+
set result {}
44+
foreach token $tokens {
45+
set t [string trim $token]
46+
if {$t eq "" || [catch {expr {int($t)}} val]} usage
47+
lappend result $val
48+
}
49+
return $result
50+
}
51+
52+
proc maximumSubarraySum {numbers} {
53+
if {[llength $numbers] == 0} { return 0 }
54+
55+
set currentSum [lindex $numbers 0]
56+
set maxSum $currentSum
57+
58+
for {set i 1} {$i < [llength $numbers]} {incr i} {
59+
set val [lindex $numbers $i]
60+
set currentSum [expr {max($val, $currentSum + $val)}]
61+
set maxSum [expr {max($maxSum, $currentSum)}]
62+
}
63+
64+
return $maxSum
65+
}
66+
67+
if {$argc != 1} { usage }
68+
69+
set numbers [parseList [lindex $argv 0]]
70+
puts [maximumSubarraySum $numbers]
71+
72+
```
73+
74+
{% endraw %}
75+
76+
Maximum Subarray in [Tcl](https://sampleprograms.io/languages/tcl) was written by:
77+
78+
- Ștefan-Iulian Alecu
79+
80+
If you see anything you'd like to change or update, [please consider contributing](https://github.com/TheRenegadeCoder/sample-programs).
81+
82+
## How to Implement the Solution
83+
84+
No 'How to Implement the Solution' section available. [Please consider contributing](https://github.com/TheRenegadeCoder/sample-programs-website).
85+
86+
## How to Run the Solution
87+
88+
No 'How to Run the Solution' section available. [Please consider contributing](https://github.com/TheRenegadeCoder/sample-programs-website).

0 commit comments

Comments
 (0)