Skip to content

Commit 7ff4d5c

Browse files
committed
Improving program that counts itself.
1 parent 015f752 commit 7ff4d5c

2 files changed

Lines changed: 23 additions & 3 deletions

File tree

source/code/projects/FileCountProgram/FileCountProgram/Program.cs

Lines changed: 20 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,15 +5,32 @@ class Program
55
{
66
static void Main()
77
{
8-
// The following goes to /bin/Debug, then two folders up,
9-
// where Program.cs is located.
8+
9+
string filePath = Path.Combine(
10+
new DirectoryInfo(
11+
Directory.GetCurrentDirectory()
12+
).ToString(),
13+
"Program.cs"
14+
);
15+
16+
/*
17+
* On older versions, you may need to use the following instead,
18+
* as the program is executed in /bin/Debug, we need to go
19+
* two folders up, where Program.cs is located: note the ".Parent"
20+
* bits in the code that follows.
21+
*/
22+
23+
/*
24+
1025
string filePath = Path.Combine(
1126
new DirectoryInfo(
1227
Directory.GetCurrentDirectory()
1328
).Parent.Parent.ToString(),
1429
"Program.cs"
1530
);
16-
31+
32+
*/
33+
1734
if (!File.Exists(filePath))
1835
{
1936
Console.WriteLine(

source/templates/pdf/header.tex

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,9 @@
6262
\newunicodechar{͟}{\symb ͟} % U+035F
6363
\newunicodechar{̲}{\symb ͟} % U+0332
6464
% it would be nicer to use U+0332 ◌̲ COMBINING LOW LINE but I wasn't able to make it work.
65+
% could also try with U+005.
66+
% question asked at https://tex.stackexchange.com/questions/695346/define-macron-below-combining-low-line-u0332-as-a-unicode-character-to-un
67+
6568

6669
% This character "🛡", apparently also represented with "◌️" and ️" "
6770
% and known as U+FE0F, "VARIATION SELECTOR-16"

0 commit comments

Comments
 (0)