{"id":20767471,"url":"https://github.com/mosespace/magic-date-in-console.net","last_synced_at":"2026-03-15T11:01:41.902Z","repository":{"id":168225574,"uuid":"561637243","full_name":"mosespace/Magic-Date-In-console.net","owner":"mosespace","description":"Program that checks magic dates in console.net","archived":false,"fork":false,"pushed_at":"2022-11-04T07:51:44.000Z","size":91,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-12-25T23:37:37.687Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Visual Basic .NET","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mosespace.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-11-04T06:13:14.000Z","updated_at":"2022-11-06T13:56:59.000Z","dependencies_parsed_at":null,"dependency_job_id":"d5f79d84-ec18-46cf-ac08-254ba149c024","html_url":"https://github.com/mosespace/Magic-Date-In-console.net","commit_stats":null,"previous_names":["mosespace/magic-date-in-console.net"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/mosespace/Magic-Date-In-console.net","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mosespace%2FMagic-Date-In-console.net","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mosespace%2FMagic-Date-In-console.net/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mosespace%2FMagic-Date-In-console.net/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mosespace%2FMagic-Date-In-console.net/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mosespace","download_url":"https://codeload.github.com/mosespace/Magic-Date-In-console.net/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mosespace%2FMagic-Date-In-console.net/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30540734,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-15T07:17:37.589Z","status":"ssl_error","status_checked_at":"2026-03-15T07:17:31.738Z","response_time":61,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-17T11:31:50.889Z","updated_at":"2026-03-15T11:01:41.862Z","avatar_url":"https://github.com/mosespace.png","language":"Visual Basic .NET","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Magic-Date-In-console.net\nProgram that checks magic dates in console.net\n\n# Problem: Magic Dates\n\nDate is given in a \"dd-mm-yyyy\" format, e.g. 17-04-2018. We calculate the weight of that date by taking all of its digits, multiplying each digit with the others after it, and finally summing up all the results obtained. In our case, we have 8 digits: 17032007, so the weight is 1*7 + 1*0 + 1*3 + 1*2 + 1*0 + 1*0 + 1*7 + 7*0 + 7*3 + 7*2 + 7*0 + 7*0 + 7*7 + 0*3 + 0*2 + 0*0 + 0*0 + 0*7 + 3*2 + 3*0 + 3*0 + 3*7 + 2*0 + 2*0 + 2*7 + 0*0 + 0*7 + 0*7 = 144.\n\nOur task is to write a program that finds all the magical dates between two specific years (inclusively) corresponding to given weight. Dates must be printed in ascending order (by date) in the format \"dd-mm-yyyy\". We will only use the valid dates in the traditional calendar (the leap years have 29 days in February).\n\n# Input Data\nInput data should be read from the console. It consists of 3 lines:\n\n- The first line contains an integer: start year.\n- The second line contains an integer: end year.\n- The third line contains an integer: the search weight for the dates.\n- Input data will always be valid and will always be in the format described. No need to check.\n\n# Output Data\nThe result should be printed on the console as consecutive dates in \"dd-mm-yyyy\" format, sorted by date in ascending order. Each string must be in a separate line. If there are no existing magic dates, print \"No\".\n\n## Constraints\n\n- The start and final year are integer numbers in the range [1900 … 2100].\n- Magic weight is an integer in the range [1 … 1000].\n- Allowed program time: 0.25 seconds.\n- Allowed memory: 16 MB.\n\n# Sample Input and Output\n| Input  | Output | Input | Output |\n| ------------- | ------------- | ------------- | ------------- |\n| 2007 \u003cbr\u003e 2007 \u003cbr\u003e 144  | 17-03-207 \u003cbr\u003e 13-07-2007 \u003cbr\u003e 31-07-2007  | 2003 \u003cbr\u003e 2004 \u003cbr\u003e 1500 \u003cbr\u003e  | No  |\n\n| Input  | Output | Input | Output |\n| --- | --- | --- | --- |\n| ------------- | ------------- | ------------- | ------------- |\n| 2012 \u003cbr\u003e 2014 \u003cbr\u003e 80  |09-01-2013 \u003cbr\u003e 17-01-2013 \u003cbr\u003e 23-03-2013 \u003cbr\u003e 11-07-2013 \u003cbr\u003e 01-09-2013 \u003cbr\u003e 10-09-2013 \u003cbr\u003e 09-10-2013 \u003cbr\u003e 17-10-2013 \u003cbr\u003e 07-11-2013 \u003cbr\u003e 24-11-2013 \u003cbr\u003e 14-12-2013 \u003cbr\u003e23-11 \u003cbr\u003e 2014 \u003cbr\u003e 13-12-2014 \u003cbr\u003e 31-12-2014 | 2011 \u003cbr\u003e 2012 \u003cbr\u003e 14 \u003cbr\u003e  |01-01-2011 \u003cbr\u003e10-01-2011 \u003cbr\u003e 01-10-2011 \u003cbr\u003e 10 10-2011 |\n\n# Hints and Guidelines\nWe start with the input data. In this case, we have 3 integers that should be read from the console, as this is the only entry and processing of input for the problem.\n\nHaving the start and the end year, it is nice to know how we will go through every date, not to worry about how many days there are in the month and whether it is a leap year, and so on.\n\n# Loop through Dates\nFor looping through the dates, we will take advantage of the functionality that gives us the DateTime class in C#. We will define a start date variable that we can do using the constructor that accepts a year, month, and day. We know the year is the starting year we read from the console and the month and the day must be January and 1st respectively. In C#, the \"constructor\" of DateTime accepts as first argument the year, as second argument the month and as third argument the day of the month:\n\nDateTime CurrentD = new DateTime(startYear, 1, 1);\n\nOnce we have the start date, we want to create a loop that runs until we exceed the final year (or until we pass December 31 in the final year if we compare the full dates), increasing each day by 1 day.\n\nTo increase by one day in each rotation, we will use a method of DateTime – .AddDays(…), which will add one day to the current date. The method will take care instead of us, to decide where to skip the next month, how many days there is a month and everything around the leap years.\n\ncurrentDate = currentDate.addDays(1);\n\nCaution: since the [.AddDays(…)] method returns the \"new\" date, it is important to assign the result, not just to call the method!\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmosespace%2Fmagic-date-in-console.net","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmosespace%2Fmagic-date-in-console.net","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmosespace%2Fmagic-date-in-console.net/lists"}