Skip to content

Commit 34defe2

Browse files
committed
Generated Sample Programs website automatically
on-behalf-of: @TheRenegadeCoder <jeremy.grifski@therenegadecoder.com>
1 parent a5c116f commit 34defe2

File tree

5 files changed

+103
-12
lines changed

5 files changed

+103
-12
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 1485 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 1486 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: 8 additions & 8 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 1291 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 1292 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.36%</td>
21+
<td class="right">7.35%</td>
2222
<td class="bar-graph"><div style="width: 100.00%; background-color: #AF425E;"></div></td>
2323
</tr>
2424

@@ -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.59%</td>
51+
<td class="right">4.58%</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.55%</td>
57+
<td class="right">4.54%</td>
5858
<td class="bar-graph"><div style="width: 61.81%; background-color: #555555;"></div></td>
5959
</tr>
6060

@@ -174,8 +174,8 @@ Here are the percentages for each language in the collection:
174174

175175
<tr>
176176
<td class="right nowrap">Tcl</td>
177-
<td class="right">0.80%</td>
178-
<td class="bar-graph"><div style="width: 10.92%; background-color: #E4CC98;"></div></td>
177+
<td class="right">0.85%</td>
178+
<td class="bar-graph"><div style="width: 11.53%; background-color: #E4CC98;"></div></td>
179179
</tr>
180180

181181
<tr>
@@ -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 51 code snippets.
1266+
The 'T' collection contains 5 languages, of which 5 are tested, and 52 code snippets.
12671267

1268-
- [Tcl](https://sampleprograms.io/languages/tcl) (10 code snippets)
1268+
- [Tcl](https://sampleprograms.io/languages/tcl) (11 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: 2 additions & 1 deletion
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 10 articles:
29+
There are 11 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)
@@ -36,5 +36,6 @@ There are 10 articles:
3636
- [Convex Hull in Tcl](https://sampleprograms.io/projects/convex-hull/tcl)
3737
- [Depth First Search in Tcl](https://sampleprograms.io/projects/depth-first-search/tcl)
3838
- [Dijkstra in Tcl](https://sampleprograms.io/projects/dijkstra/tcl)
39+
- [Duplicate Character Counter in Tcl](https://sampleprograms.io/projects/duplicate-character-counter/tcl)
3940
- [Fibonacci in Tcl](https://sampleprograms.io/projects/fibonacci/tcl)
4041
- [Hello World in Tcl](https://sampleprograms.io/projects/hello-world/tcl)

docs/projects/duplicate-character-counter/index.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
date: 2022-05-14
33
featured-image: duplicate-character-counter-in-every-language.jpg
4-
last-modified: 2025-10-07
4+
last-modified: 2025-10-08
55
layout: default
66
tags:
77
- duplicate-character-counter
@@ -76,7 +76,7 @@ Usage: please provide a string
7676

7777
## Articles
7878

79-
There are 25 articles:
79+
There are 26 articles:
8080

8181
- [Duplicate Character Counter in Algol68](https://sampleprograms.io/projects/duplicate-character-counter/algol68)
8282
- [Duplicate Character Counter in Awk](https://sampleprograms.io/projects/duplicate-character-counter/awk)
@@ -100,6 +100,7 @@ There are 25 articles:
100100
- [Duplicate Character Counter in Ruby](https://sampleprograms.io/projects/duplicate-character-counter/ruby)
101101
- [Duplicate Character Counter in Rust](https://sampleprograms.io/projects/duplicate-character-counter/rust)
102102
- [Duplicate Character Counter in Swift](https://sampleprograms.io/projects/duplicate-character-counter/swift)
103+
- [Duplicate Character Counter in Tcl](https://sampleprograms.io/projects/duplicate-character-counter/tcl)
103104
- [Duplicate Character Counter in Ti Basic](https://sampleprograms.io/projects/duplicate-character-counter/ti-basic)
104105
- [Duplicate Character Counter in Typescript](https://sampleprograms.io/projects/duplicate-character-counter/typescript)
105106
- [Duplicate Character Counter in Wren](https://sampleprograms.io/projects/duplicate-character-counter/wren)
Lines changed: 89 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,89 @@
1+
---
2+
authors:
3+
- "\u0218tefan-Iulian Alecu"
4+
date: 2025-10-08
5+
featured-image: duplicate-character-counter-in-every-language.jpg
6+
last-modified: 2025-10-08
7+
layout: default
8+
tags:
9+
- duplicate-character-counter
10+
- tcl
11+
title: Duplicate Character Counter in Tcl
12+
---
13+
14+
<!--
15+
AUTO-GENERATED -- PLEASE DO NOT EDIT!
16+
17+
Instead, please edit the following:
18+
19+
- sources/programs/duplicate-character-counter/tcl/how-to-implement-the-solution.md
20+
- sources/programs/duplicate-character-counter/tcl/how-to-run-the-solution.md
21+
22+
See .github/CONTRIBUTING.md for further details.
23+
-->
24+
25+
Welcome to the [Duplicate Character Counter](https://sampleprograms.io/projects/duplicate-character-counter) 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 string"
34+
exit 1
35+
}
36+
37+
proc countDuplicates {str} {
38+
set counts [dict create]
39+
set order {}
40+
41+
foreach ch [split $str {}] {
42+
if {[string is alnum -strict $ch]} {
43+
if {![dict exists $counts $ch]} {
44+
lappend order $ch
45+
}
46+
dict incr counts $ch 1
47+
}
48+
}
49+
50+
set printed 0
51+
52+
foreach ch $order {
53+
set count [dict get $counts $ch]
54+
if {$count > 1} {
55+
puts "$ch: $count"
56+
incr printed
57+
}
58+
}
59+
60+
if {$printed == 0} {
61+
puts "No duplicate characters"
62+
}
63+
}
64+
65+
if {$argc != 1} { usage }
66+
67+
set input [string trim [lindex $argv 0]]
68+
if {$input eq ""} { usage }
69+
70+
countDuplicates $input
71+
72+
73+
```
74+
75+
{% endraw %}
76+
77+
Duplicate Character Counter in [Tcl](https://sampleprograms.io/languages/tcl) was written by:
78+
79+
- Ștefan-Iulian Alecu
80+
81+
If you see anything you'd like to change or update, [please consider contributing](https://github.com/TheRenegadeCoder/sample-programs).
82+
83+
## How to Implement the Solution
84+
85+
No 'How to Implement the Solution' section available. [Please consider contributing](https://github.com/TheRenegadeCoder/sample-programs-website).
86+
87+
## How to Run the Solution
88+
89+
No 'How to Run the Solution' section available. [Please consider contributing](https://github.com/TheRenegadeCoder/sample-programs-website).

0 commit comments

Comments
 (0)