<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Daniel Yunus</title>
    <description>The latest articles on DEV Community by Daniel Yunus (@danibwuoy02).</description>
    <link>https://dev.to/danibwuoy02</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F958452%2Ffd953067-3729-4aaa-937f-173c458aa853.jpg</url>
      <title>DEV Community: Daniel Yunus</title>
      <link>https://dev.to/danibwuoy02</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/danibwuoy02"/>
    <language>en</language>
    <item>
      <title>Game Backend : Chapter 2 - Setup Nginx Web Server</title>
      <dc:creator>Daniel Yunus</dc:creator>
      <pubDate>Wed, 21 Feb 2024 18:23:17 +0000</pubDate>
      <link>https://dev.to/danibwuoy02/game-backend-chapter-2-setup-nginx-web-server-1md6</link>
      <guid>https://dev.to/danibwuoy02/game-backend-chapter-2-setup-nginx-web-server-1md6</guid>
      <description>&lt;p&gt;Yolo fellow game developers. Welcome to the lates chapter of our game backend series. &lt;/p&gt;

&lt;p&gt;In this blog, we'll go through the process of setting up a web server. By the end of this chapter, you'll have a running NGINX server on the cloud, ready to handle your game's backend needs. So let's gear up and get started.&lt;br&gt;
&lt;br&gt;&lt;/p&gt;
&lt;h2&gt;
  
  
  What is NGINX?
&lt;/h2&gt;

&lt;p&gt;Nginx is an open source web server that can act as a reverse proxy, a load balancer or HTTP cache. It is designed to deliver content quickly and efficiently to the users. It doesn't rely on threads to handle requests, it uses event driven architecture which allows it to handle multiple concurrent connections without consuming much memory.&lt;/p&gt;

&lt;p&gt;By setting up nginx as a reverse proxy, it acts as an intermediary that takes requests from the user and directs them to the appropriate backend server. This way it speeds up content delivery, load balances the traffic and enhances security that helps game developers to optimize their game backend server performance. &lt;br&gt;
&lt;br&gt;&lt;/p&gt;
&lt;h2&gt;
  
  
  Pre-requisites
&lt;/h2&gt;

&lt;p&gt;An AWS account that can be used to spin up a new AWS EC2 instance.&lt;br&gt;
&lt;br&gt;&lt;br&gt;
Let's GOOOO!&lt;br&gt;
&lt;br&gt;&lt;/p&gt;
&lt;h3&gt;
  
  
  &lt;strong&gt;Step 1: Launch an EC2 instance&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;Launch an EC2 instance from the AWS console. &lt;/p&gt;

&lt;p&gt;Choose Ubuntu AMI of instance type t2.micro as this is a free tier eligible.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fot4k3d1spwhge4hvn24c.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fot4k3d1spwhge4hvn24c.png" alt="Image description" width="800" height="676"&gt;&lt;/a&gt;&lt;br&gt;
Select an existing key pair for login or create a new key pair.&lt;br&gt;
&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F1s6ckv1d0qk4ot3y91fo.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F1s6ckv1d0qk4ot3y91fo.png" alt="Image description" width="800" height="536"&gt;&lt;/a&gt;&lt;br&gt;
 Create a new security group and check all the traffic options for testing.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fqbq188fun4nk8cgfq7hh.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fqbq188fun4nk8cgfq7hh.png" alt="Image description" width="800" height="583"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;h3&gt;
  
  
  &lt;strong&gt;Step 2: SSH Connect to instance&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;Connect to your instance using terminal or SSH client.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;ssh -i key.pem ec2_username@ec2_public_ip
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;h3&gt;
  
  
  &lt;strong&gt;Step 3: Install Nginx&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;Run the following commands to update the packages and then install nginx.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;sudo apt update
sudo apt install nginx
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  &lt;strong&gt;Step 4: Configure Nginx&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;We can configure nginx to server as a reverse proxy by editing the configuration at "/etc/nginx/sites-available/", but we will do that in a future tutorial blog.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;sudo systemctl status nginx
sudo system start nginx
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Finally you can test if nginx is configured correctly by opening your ec2 instance url or IPv4 address in the browser. You should see the web page as shown below:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fkck0iegeu2qxhyozsbti.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fkck0iegeu2qxhyozsbti.png" alt="Image description" width="800" height="432"&gt;&lt;/a&gt;&lt;br&gt;
&lt;br&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Conclusion
&lt;/h2&gt;

&lt;p&gt;By following this tutorial, you have successfully setup a nginx web server, allowing you to serve web content. Explore nginx further to understand advanced features and capabilities of nginx. In the next tutorial, we will setup a REST api to send and receive data to and from our game.&lt;br&gt;
Stay tuned!!! GG!!&lt;/p&gt;

</description>
    </item>
    <item>
      <title>Game Backend : Chapter 1 - Introduction</title>
      <dc:creator>Daniel Yunus</dc:creator>
      <pubDate>Mon, 11 Dec 2023 18:51:09 +0000</pubDate>
      <link>https://dev.to/danibwuoy02/game-backend-chapter-1-introduction-149a</link>
      <guid>https://dev.to/danibwuoy02/game-backend-chapter-1-introduction-149a</guid>
      <description>&lt;p&gt;Yolo fellow game developers. I am writing this blog series to understand various aspects of game backend development. &lt;/p&gt;

&lt;p&gt;In this blog, we will start by understanding "What a game backend is?", and in the next upcoming blogs we'll learn the key aspects required to implement backend servers, deploying api's to them and also connecting those api's with our game. &lt;/p&gt;

&lt;p&gt;I will be using Unity as the game engine and AWS for implementing the backend architecture, but we will understand the core concepts behind the implementation so we can apply those concepts for any tech stack you prefer. Let's get started.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--kjQhxj5z--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/72t1p5ofhl1u11vhssoo.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--kjQhxj5z--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/72t1p5ofhl1u11vhssoo.png" alt="Server room" width="800" height="800"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  What is a Game Backend?
&lt;/h2&gt;

&lt;p&gt;In game development, the term "back end" refers to server side technologies that help in providing various remote or online services to manage player and game state and enhance the overall gaming experience.&lt;/p&gt;

&lt;p&gt;Game Backends are usually implemented using RESTful API's that will be accessed by the game clients (games installed on your device or consoles) using HTTP/HTTPS requests.&lt;/p&gt;

&lt;p&gt;Here is a list of few of the essential functionalities that are implemented using a gaming backend:&lt;/p&gt;

&lt;p&gt;• &lt;strong&gt;Multiplayer Support&lt;/strong&gt; : It helps in authenticating and authorising players, manage player accounts and data which helps in maintaining the integrity of multiplayer gaming environments. It also helps in matchmaking players with similar skills to make the game more competitive and enjoyable.&lt;/p&gt;

&lt;p&gt;• &lt;strong&gt;Data Storage and Management&lt;/strong&gt; : Game backends help in securely storing player profile data, game progress and statistics, leaderboard data and other types of telemetry data which help in making the game better and profitable.&lt;/p&gt;

&lt;p&gt;• &lt;strong&gt;Content Delivery&lt;/strong&gt; : It also helps in delivering dynamic content, updates and patches for ensuring continuous improvement without having the need to push app updates post-launch.&lt;/p&gt;

&lt;p&gt;• &lt;strong&gt;Communication&lt;/strong&gt; : It helps in maintaining a connection between the player and the backend services in order to sync the game and maintaining smooth gameplay. It also helps players to communicate with each other in case of multiplayer games.&lt;/p&gt;

&lt;p&gt;• &lt;strong&gt;Data and Logic Processing&lt;/strong&gt; : Complex game logic calculations which are too heavy for client processing are handled by backend servers. Apart from this, backend servers use real time analytics and machine learning processing to provide personalised gaming experience.&lt;/p&gt;




&lt;h2&gt;
  
  
  Types of backend architectures
&lt;/h2&gt;

&lt;p&gt;Here's an overview of some of the backend architectures:&lt;/p&gt;

&lt;h3&gt;
  
  
  Instance based architecture
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;These are the traditional dedicated servers which can be either physical servers or cloud based virtual servers.&lt;/li&gt;
&lt;li&gt;Each instance in this type of architecture can run its own operating system and own set of applications which gives the developers complete control over the server environment.&lt;/li&gt;
&lt;li&gt;Since resources are not shared, performance is stable which makes it suitable for games with steady player traffic.&lt;/li&gt;
&lt;li&gt;Games like 'Minecraft' often use dedicated servers whereas small indie games use cost effective virtualized server instances.&lt;/li&gt;
&lt;li&gt;Amazon EC2, Google Compute Engine, Digital Ocean droplets are few examples of cloud based instance server platforms.
&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Serverless architecture
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;The term 'serverless' is misleading. It doesn't mean there are no servers in this architecture, rather it is a cloud based model where the cloud provider manages the complexity of the infrastructure and allocation of server resources when required.&lt;/li&gt;
&lt;li&gt;It is extremely suitable for developers who want to focus purely on the game feature development usually as microservices and not care about the underlying infrastructure complexities. That's why the name 'serverless'. &lt;/li&gt;
&lt;li&gt;Game backend services with variable traffic can benefit from this architecture as you mostly pay for the resources that have been allocated by the provider based on the traffic making it cost effective and reliable.&lt;/li&gt;
&lt;li&gt;For example, REST API's to update player scores and store transactions can be implemented using AWS Lambda functions along with AWS Gateway API or by using Google Cloud Functions with Google API Gateway.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Container based architecture
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;This architecture involves packaging your game backend into containers.&lt;/li&gt;
&lt;li&gt;Containers are isolated packages containing the code, runtime, libraries required to run your backend code.&lt;/li&gt;
&lt;li&gt;These containers are portable and can be hosted on the developer's workstation, dedicated servers or other types of infrastructure, thus making it consistent irrespective of the underlying architecture.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Peer-to-Peer architecture
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;In this architecture, instead of relying on a central server, each player's device directly communicates with other player's device. Each peer, acts both as the client and the server.&lt;/li&gt;
&lt;li&gt;One peer acts as the host or the master peer, handling some of the critical functions who is selected mainly based on connection stability or hardware capabilities.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Blockchain architecture
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Unlike storing data and in game transactions on a single server, data is stored across a network of computers or servers, thus making the data immutable and resilient to tampering.&lt;/li&gt;
&lt;li&gt;New monetisation models like the play to earn model use blockchain technology.&lt;/li&gt;
&lt;li&gt;Platforms like Enjin and Sandbox use blockchain to implement gaming ecosystem.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Types of servers
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--Ahzwbzz4--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/83se04s6yll9py9jiru2.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--Ahzwbzz4--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/83se04s6yll9py9jiru2.jpg" alt="Types of Servers" width="800" height="287"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Web Server
&lt;/h3&gt;

&lt;p&gt;In game development, a web server manages requests over HTTP protocol and other such protocols from game clients which can be your game app or a browser. It processes the requests and provides the required response to the client which may include HTML static content, images, videos, etc. It can also act as a gateway or proxy to other servers.&lt;/p&gt;

&lt;p&gt;Examples of web servers:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Nginx&lt;/li&gt;
&lt;li&gt;Apache HTTP Server&lt;/li&gt;
&lt;li&gt;Windows IIS&lt;/li&gt;
&lt;li&gt;Node.js&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Application Server
&lt;/h3&gt;

&lt;p&gt;An application server hosts the web application and api's responsible to process game logic, data processing and connecting with the database servers to serve dynamic content based on the incoming requests.&lt;/p&gt;

&lt;p&gt;Examples of Application Servers:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Flask Gunicorn&lt;/li&gt;
&lt;li&gt;.NET Application Servers&lt;/li&gt;
&lt;li&gt;Node.js application servers&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  File Servers
&lt;/h3&gt;

&lt;p&gt;A file server is used to store and manage files. It can be used to store game assets, updates and patches that player clients can download. Cloud file storage services like AWS S3 buckets can also be considered a type of file server.&lt;/p&gt;

&lt;h2&gt;
  
  
  Conclusion
&lt;/h2&gt;

&lt;p&gt;As we conclude the introduction of game backends, the next chapter will be more about turning theory to practice. We will learn about setting up an AWS EC2 instance with an Nginx web server making it easy for beginner developers in getting started with building their own game backend architectures.&lt;br&gt;
Stay tuned!!! GG!!&lt;/p&gt;




&lt;h3&gt;
  
  
  Social Media :
&lt;/h3&gt;

&lt;p&gt;&lt;a href="//linktr.ee/danibwuoy"&gt;Daniel Yunus&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Games :
&lt;/h3&gt;

&lt;p&gt;&lt;a href="https://gamebeestudio.com"&gt;Gamebee Studio&lt;/a&gt;&lt;br&gt;
&lt;a href="https://chuchugames.com"&gt;CC Games Studio&lt;/a&gt;&lt;/p&gt;

</description>
    </item>
    <item>
      <title>Future of Gaming Industry in India</title>
      <dc:creator>Daniel Yunus</dc:creator>
      <pubDate>Sun, 13 Aug 2023 17:16:09 +0000</pubDate>
      <link>https://dev.to/danibwuoy02/future-of-gaming-industry-in-india-2023-3i7k</link>
      <guid>https://dev.to/danibwuoy02/future-of-gaming-industry-in-india-2023-3i7k</guid>
      <description>&lt;h2&gt;
  
  
  Introduction:
&lt;/h2&gt;

&lt;p&gt;The gaming industry in India is experiencing rapid growth and offers promising prospects for individuals to pursue gaming as a viable career choice. In this blog, we dive into the size of the gaming industry in India, it's potential for further expansion, and the various opportunities it presents.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--wuIjlSyc--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/e17nflajptyf4ev4ij2g.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--wuIjlSyc--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/e17nflajptyf4ev4ij2g.jpg" alt="Gamebee Studio Game" width="800" height="450"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  The Rise of Gaming:
&lt;/h2&gt;

&lt;p&gt;Gaming has transformed from being seen as just a hobby to a legitimate career option. With the success of games like Ludo King, which generated $20 million in a year and boasts 50 million daily players, the gaming industry is poised to surpass music, movies, and TV shows. With the rise in gamers and game developers, new startups like &lt;a href="//gamebeestudio.com"&gt;Gamebee Studio&lt;/a&gt; and &lt;a href="//chuchugames.com"&gt;ChuchuGames Studio&lt;/a&gt; are emerging&lt;/p&gt;

&lt;h2&gt;
  
  
  India's Gaming Industry Potential:
&lt;/h2&gt;

&lt;p&gt;The gaming industry is three times larger than the film industry globally, but India only receives 1% of the revenue from this $198 billion market.The Indian government is taking the gaming industry seriously, aiming to create around 1.6 lakh jobs in the AVCG sector through the implementation of a National AVCG policy and skill development initiatives.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--rAVGwVFm--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/q76y16s00mjsifv69kfz.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--rAVGwVFm--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/q76y16s00mjsifv69kfz.jpg" width="800" height="738"&gt;&lt;/a&gt;&lt;/p&gt;
Image Source: Forbes



&lt;h4&gt;
  
  
  Future of apps:
&lt;/h4&gt;

&lt;p&gt;The future of apps lies in games, as they have the ability to captivate and engage users, surpassing the popularity of traditional apps and presenting opportunities for growth and innovation and with the emergence of new platforms like VR and AR presenting opportunities for businesses and individuals to capitalize on. Games in India, like Genshin Impact, have the potential to generate significant revenue and attract venture capital, which is crucial for the growth of the industry.&lt;/p&gt;

&lt;h4&gt;
  
  
  The Surge of Mobile Usage:
&lt;/h4&gt;

&lt;p&gt;In India, mobile phones are crucial because the majority of the population relies on them for work, banking, and running businesses, due to the lack of access to laptops or PCs.&lt;br&gt;
Mobile phones now have powerful graphics cards that can render lifelike 3D objects, allowing for mobile games to look better than from a few years ago.&lt;br&gt;
The increase in game downloads and play can be attributed to the affordability and accessibility of unlimited internet data plans provided by Jio.&lt;/p&gt;

&lt;h2&gt;
  
  
  Flourishing Careers and Opportunities:
&lt;/h2&gt;

&lt;p&gt;More games are being created due to the popularity of free engines like Unreal and Unity, leading to new developers in India joining companies or starting their own studios, coinciding with the startup boom, and producing enjoyable games for both PC and mobile.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--bPxvpSdJ--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/0vc8oe6h8l6j1yhcgeub.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--bPxvpSdJ--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/0vc8oe6h8l6j1yhcgeub.png" width="800" height="604"&gt;&lt;/a&gt;&lt;/p&gt;
Image Source : https://idreamcareer.com/




&lt;p&gt;Here are some career options you can explore in the gaming industry:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;Game Developer/Programmer: Game developers create the code and technical aspects of games like gameplay mechanics, AI, graphics, physics, and more. Specializations include gameplay programmer, AI programmer, graphics programmer, AR/VR developer etc.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Game Designer: Game designers come up with game concepts, mechanics, levels, and overall gameplay experience. They work on creating engaging and enjoyable player experiences.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Game Artist: Game artists create the visual elements of games. This includes character design, environment art, 3D modeling, concept art, animation, and more.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Game Animator: Game animators focus on creating movement and character actions within the game.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Game Tester/QA Tester: Game testers play games to find bugs, glitches, and other issues. Their feedback is crucial for improving the game's quality before release.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Game Producer/Project Manager: Producers manage the development process, coordinating teams, timelines, budgets, and ensuring the game's progress aligns with the vision.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Story Writer: Story writers create the storylines, dialogues, and narratives for games and contribute to the game's plot, characters, and immersive experiences.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Level Designer: Level designers create the layout, challenges, and flow of game levels. They ensure that players have a balanced and engaging experience.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Sound Designer: Sound designers create the audio elements of games, including music, sound effects, voice acting, and atmospheric sounds.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Game Marketing/PR: Professionals in this field handle promoting and marketing games to the target audience, creating buzz around releases, and managing public relations.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Game Monetization Specialist: These specialists work on strategies to monetize games through in-app purchases, advertisements, and other revenue streams.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Esports Manager/Coordinator: With the growth of esports, roles in event coordination, team management, and esports marketing are becoming prominent.&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  Challenges:
&lt;/h2&gt;

&lt;p&gt;As someone involved in or aspiring to be a part of the Indian gaming industry, it is essential to understand the implications of the government's decision on taxation.&lt;/p&gt;

&lt;p&gt;The Indian gaming industry is divided into two categories: games without money transactions and fantasy/real money games that involve entry fees and the motivation to win money in return wherein players can improve their abilities through practice and experience in certain games, emphasizing the importance of skill in determining the outcome.&lt;/p&gt;

&lt;p&gt;More than 70% of the revenue in the Indian gaming industry comes from fantasy and real money games. In contrast, The Indian government has imposed a 28% GST on online gaming, impacting the revenue of real money gaming and fantasy sports companies which is negatively impacting the Indian gaming industry, leading to reduced player engagement, job losses, and a decline in tax collection.&lt;/p&gt;

&lt;p&gt;It's worth noting that 28% GST on online gaming in India does not affect traditional non-real money games like CandyCrush, Pokemon GO, Genshin Impact, etc, but it may make it difficult for RMG and fantasy sports companies to earn as much money as before.&lt;/p&gt;

&lt;h2&gt;
  
  
  Conclusion:
&lt;/h2&gt;

&lt;p&gt;The future of the gaming industry in India is bright, with expanding opportunities and the potential to make a logical career choice in the 21st century. As the industry continues to grow and expected to reach over $8.5 billion by 2027, individuals can pursue their passion for gaming, capitalize on emerging technologies, and contribute to the thriving gaming ecosystem.&lt;/p&gt;

</description>
    </item>
    <item>
      <title>C# Program to convert decimal integers to roman numerals.</title>
      <dc:creator>Daniel Yunus</dc:creator>
      <pubDate>Sun, 20 Nov 2022 10:18:22 +0000</pubDate>
      <link>https://dev.to/danibwuoy02/c-program-to-convert-decimal-integers-to-roman-numerals-19j7</link>
      <guid>https://dev.to/danibwuoy02/c-program-to-convert-decimal-integers-to-roman-numerals-19j7</guid>
      <description>&lt;h1&gt;
  
  
  Introduction
&lt;/h1&gt;

&lt;p&gt;Hi, I am Daniel Yunus 😃. I am a game developer 🎮 and a data analyst 💻, I am here to learn and share. In this article we will solve a problem to convert decimal integers to roman numerals.&lt;/p&gt;




&lt;h1&gt;
  
  
  Description
&lt;/h1&gt;

&lt;p&gt;Roman numerals are represented using 7 symbols as follows:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Roman Symbol&lt;/th&gt;
&lt;th&gt;Value&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;I&lt;/td&gt;
&lt;td&gt;1&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;V&lt;/td&gt;
&lt;td&gt;5&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;X&lt;/td&gt;
&lt;td&gt;10&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;L&lt;/td&gt;
&lt;td&gt;50&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;C&lt;/td&gt;
&lt;td&gt;100&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;D&lt;/td&gt;
&lt;td&gt;500&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;M&lt;/td&gt;
&lt;td&gt;1000&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;A roman numeral has the following properties: &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;It is written from left to right in descending order.&lt;br&gt;
&lt;strong&gt;Example&lt;/strong&gt; : 2 is written as 'II' which is 'I'+'I' or 1+1, 6 is written as 'VI' which is 'V'+'I' or 5+1.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;A character cannot be repeated four times in succession. Subtraction notation is used to represent such instances.&lt;br&gt;
&lt;strong&gt;Example&lt;/strong&gt; : 4 is not written as 'IIII', rather it is written as 'IV'. In this case 'I' is written before 'V' which denotes 'I' should be subtracted from 'V' i.e., 'V'-'I'(5-1=4).&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;There are 6 instances where subtraction notation is used:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;'I' is placed before 'V'(5) to make 'IV'(4).&lt;/li&gt;
&lt;li&gt;'I' is placed before 'X'(10) to make 'IX'(9).&lt;/li&gt;
&lt;li&gt;'X' is placed before 'L'(50) to make 'XL'(40).&lt;/li&gt;
&lt;li&gt;'X' is placed before 'C'(100) to make 'XC'(90).&lt;/li&gt;
&lt;li&gt;'C' is placed before 'D'(500) to make 'CD'(400).&lt;/li&gt;
&lt;li&gt;'C' is placed before 'M'(1000) to make 'CM'(900).&lt;/li&gt;
&lt;/ul&gt;




&lt;h1&gt;
  
  
  Examples
&lt;/h1&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Input&lt;/th&gt;
&lt;th&gt;Output&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;2&lt;/td&gt;
&lt;td&gt;II&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;40&lt;/td&gt;
&lt;td&gt;XL&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;1996&lt;/td&gt;
&lt;td&gt;MCMXCVI&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;




&lt;h1&gt;
  
  
  Solution
&lt;/h1&gt;

&lt;h3&gt;
  
  
  Algorithm:
&lt;/h3&gt;

&lt;ol&gt;
&lt;li&gt;Iterate through each symbol/character in Roman numeral string starting from index 0.&lt;/li&gt;
&lt;li&gt;Get corresponding integer value of the current symbol. &lt;/li&gt;
&lt;li&gt;If current value of symbol is greater than next value of symbol, then add this value to the total result.
Else, subtract the current symbol value from the total result, if the next symbol value is less than 10 times the current value.
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight csharp"&gt;&lt;code&gt;&lt;span class="k"&gt;using&lt;/span&gt; &lt;span class="nn"&gt;System&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="k"&gt;using&lt;/span&gt; &lt;span class="nn"&gt;System.Collections.Generic&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="k"&gt;public&lt;/span&gt; &lt;span class="k"&gt;class&lt;/span&gt; &lt;span class="nc"&gt;DecimalToRoman&lt;/span&gt;
&lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="k"&gt;private&lt;/span&gt; &lt;span class="n"&gt;Dictionary&lt;/span&gt;&lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="kt"&gt;int&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="kt"&gt;string&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt; &lt;span class="n"&gt;mapping&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

    &lt;span class="k"&gt;private&lt;/span&gt; &lt;span class="k"&gt;void&lt;/span&gt; &lt;span class="nf"&gt;InitializeDecimalToRomanMapping&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
    &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="k"&gt;if&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;mapping&lt;/span&gt; &lt;span class="p"&gt;==&lt;/span&gt; &lt;span class="k"&gt;null&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
        &lt;span class="p"&gt;{&lt;/span&gt;
            &lt;span class="n"&gt;mapping&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="n"&gt;Dictionary&lt;/span&gt;&lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="kt"&gt;int&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="kt"&gt;string&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;();&lt;/span&gt;
            &lt;span class="n"&gt;mapping&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;Add&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="m"&gt;1000&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s"&gt;"M"&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
            &lt;span class="n"&gt;mapping&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;Add&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="m"&gt;900&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s"&gt;"CM"&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
            &lt;span class="n"&gt;mapping&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;Add&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="m"&gt;500&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s"&gt;"D"&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
            &lt;span class="n"&gt;mapping&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;Add&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="m"&gt;400&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s"&gt;"CD"&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
            &lt;span class="n"&gt;mapping&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;Add&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="m"&gt;100&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s"&gt;"C"&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
            &lt;span class="n"&gt;mapping&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;Add&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="m"&gt;90&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s"&gt;"XC"&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
            &lt;span class="n"&gt;mapping&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;Add&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="m"&gt;50&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s"&gt;"L"&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
            &lt;span class="n"&gt;mapping&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;Add&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="m"&gt;40&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s"&gt;"XL"&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
            &lt;span class="n"&gt;mapping&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;Add&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="m"&gt;10&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s"&gt;"X"&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
            &lt;span class="n"&gt;mapping&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;Add&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="m"&gt;9&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s"&gt;"IX"&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
            &lt;span class="n"&gt;mapping&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;Add&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="m"&gt;5&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s"&gt;"V"&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
            &lt;span class="n"&gt;mapping&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;Add&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="m"&gt;4&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s"&gt;"IV"&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
            &lt;span class="n"&gt;mapping&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;Add&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="m"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s"&gt;"I"&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
        &lt;span class="p"&gt;}&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;

    &lt;span class="k"&gt;private&lt;/span&gt; &lt;span class="kt"&gt;string&lt;/span&gt; &lt;span class="nf"&gt;IntToRoman&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;num&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="p"&gt;{&lt;/span&gt;
      &lt;span class="k"&gt;foreach&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;KeyValuePair&lt;/span&gt;&lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="kt"&gt;int&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="kt"&gt;string&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt; &lt;span class="n"&gt;kv&lt;/span&gt; &lt;span class="k"&gt;in&lt;/span&gt; &lt;span class="n"&gt;mapping&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
      &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="k"&gt;if&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;num&lt;/span&gt; &lt;span class="p"&gt;&amp;gt;=&lt;/span&gt; &lt;span class="n"&gt;kv&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;Key&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
            &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="n"&gt;kv&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;Value&lt;/span&gt; &lt;span class="p"&gt;+&lt;/span&gt; &lt;span class="nf"&gt;IntToRoman&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;num&lt;/span&gt; &lt;span class="p"&gt;-&lt;/span&gt; &lt;span class="n"&gt;kv&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;Key&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
      &lt;span class="p"&gt;}&lt;/span&gt;

      &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="s"&gt;""&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;

    &lt;span class="k"&gt;public&lt;/span&gt; &lt;span class="k"&gt;static&lt;/span&gt; &lt;span class="k"&gt;void&lt;/span&gt; &lt;span class="nf"&gt;Main&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kt"&gt;string&lt;/span&gt;&lt;span class="p"&gt;[]&lt;/span&gt; &lt;span class="n"&gt;args&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="kt"&gt;var&lt;/span&gt; &lt;span class="n"&gt;obj&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nf"&gt;DecimalToRoman&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
        &lt;span class="n"&gt;obj&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;InitializeDecimalToRomanMapping&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
        &lt;span class="kt"&gt;var&lt;/span&gt; &lt;span class="n"&gt;input&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="kt"&gt;int&lt;/span&gt;&lt;span class="p"&gt;[]&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="m"&gt;2&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="m"&gt;40&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="m"&gt;1996&lt;/span&gt;&lt;span class="p"&gt;};&lt;/span&gt;
        &lt;span class="k"&gt;foreach&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="k"&gt;in&lt;/span&gt; &lt;span class="n"&gt;input&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
        &lt;span class="p"&gt;{&lt;/span&gt;
           &lt;span class="kt"&gt;var&lt;/span&gt; &lt;span class="n"&gt;result&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="n"&gt;obj&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;IntToRoman&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt; 
           &lt;span class="k"&gt;if&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;result&lt;/span&gt; &lt;span class="p"&gt;==&lt;/span&gt; &lt;span class="s"&gt;""&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
                &lt;span class="n"&gt;Console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;WriteLine&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"Please input a number greater than 0"&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
           &lt;span class="k"&gt;else&lt;/span&gt; &lt;span class="n"&gt;Console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;WriteLine&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"Roman Value For "&lt;/span&gt;&lt;span class="p"&gt;+&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;+&lt;/span&gt;&lt;span class="s"&gt;" is : "&lt;/span&gt;&lt;span class="p"&gt;+&lt;/span&gt;&lt;span class="n"&gt;result&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
        &lt;span class="p"&gt;}&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h1&gt;
  
  
  Concepts
&lt;/h1&gt;

&lt;h3&gt;
  
  
  Dictionary:
&lt;/h3&gt;

&lt;p&gt;In the above solution we have used a dictionary to store special decimal integers and their corresponding roman numerals.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;A dictionary is a data structure to hold key-value pairs.&lt;/li&gt;
&lt;li&gt;It is generic and dynamic in nature that means we can create a dictionary of any data type and it's size can grow according to our needs.&lt;/li&gt;
&lt;li&gt;Keys cannot be null, but values can be null.&lt;/li&gt;
&lt;li&gt;Duplicate keys are not allowed.&lt;/li&gt;
&lt;/ul&gt;

&lt;h4&gt;
  
  
  Example:
&lt;/h4&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight csharp"&gt;&lt;code&gt;&lt;span class="n"&gt;Dictionary&lt;/span&gt;&lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="kt"&gt;int&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="kt"&gt;string&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt; &lt;span class="n"&gt;mapping&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="n"&gt;Dictionary&lt;/span&gt;&lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="kt"&gt;int&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="kt"&gt;string&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;();&lt;/span&gt;
&lt;span class="n"&gt;mapping&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;Add&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="m"&gt;1000&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s"&gt;"M"&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Recursion:
&lt;/h3&gt;

&lt;p&gt;Recursion is a concept in which a function calls itself until a condition is satisfied. If a recursive function doesn't have a termination condition, the function will keep on calling itself endlessly.&lt;/p&gt;

&lt;h4&gt;
  
  
  Example:
&lt;/h4&gt;

&lt;p&gt;In the following example IntToRoman(num) calls itself recursively until it cannot find any key from the mapping smaller than the given parameter number.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight csharp"&gt;&lt;code&gt;    &lt;span class="k"&gt;private&lt;/span&gt; &lt;span class="kt"&gt;string&lt;/span&gt; &lt;span class="nf"&gt;IntToRoman&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;num&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="p"&gt;{&lt;/span&gt;
      &lt;span class="k"&gt;foreach&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;KeyValuePair&lt;/span&gt;&lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="kt"&gt;int&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="kt"&gt;string&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt; &lt;span class="n"&gt;kv&lt;/span&gt; &lt;span class="k"&gt;in&lt;/span&gt; &lt;span class="n"&gt;mapping&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
      &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="k"&gt;if&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;num&lt;/span&gt; &lt;span class="p"&gt;&amp;gt;=&lt;/span&gt; &lt;span class="n"&gt;kv&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;Key&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
            &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="n"&gt;kv&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;Value&lt;/span&gt; &lt;span class="p"&gt;+&lt;/span&gt; &lt;span class="nf"&gt;IntToRoman&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;num&lt;/span&gt; &lt;span class="p"&gt;-&lt;/span&gt; &lt;span class="n"&gt;kv&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;Key&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt; &lt;span class="c1"&gt;//recursive call&lt;/span&gt;
      &lt;span class="p"&gt;}&lt;/span&gt;

      &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="s"&gt;""&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="c1"&gt;//recursion termination&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;Recursion should be used only when performance is not a priority.&lt;/li&gt;
&lt;li&gt;Time complexity of a recursive function increases if the number of recursive calls increases.&lt;/li&gt;
&lt;li&gt;It should only be used in cases where time complexity is not an issue and code reduction is a priority.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Thank You. Follow for more such content 😃 💻.&lt;/p&gt;

</description>
    </item>
    <item>
      <title>C# Program to convert Roman numerals to decimal integers.</title>
      <dc:creator>Daniel Yunus</dc:creator>
      <pubDate>Sun, 30 Oct 2022 15:32:36 +0000</pubDate>
      <link>https://dev.to/danibwuoy02/c-program-to-convert-roman-numerals-to-decimal-integers-1in7</link>
      <guid>https://dev.to/danibwuoy02/c-program-to-convert-roman-numerals-to-decimal-integers-1in7</guid>
      <description>&lt;h1&gt;
  
  
  Introduction
&lt;/h1&gt;

&lt;p&gt;Hi, I am Daniel Yunus 😃. I am a game developer 🎮 and a data analyst 💻, I am here to learn and share. In this article we will solve a problem to convert roman numerals to decimal integers.&lt;/p&gt;




&lt;h1&gt;
  
  
  Description
&lt;/h1&gt;

&lt;p&gt;Roman numerals are represented using 7 symbols as follows:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Roman Symbol&lt;/th&gt;
&lt;th&gt;Value&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;I&lt;/td&gt;
&lt;td&gt;1&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;V&lt;/td&gt;
&lt;td&gt;5&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;X&lt;/td&gt;
&lt;td&gt;10&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;L&lt;/td&gt;
&lt;td&gt;50&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;C&lt;/td&gt;
&lt;td&gt;100&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;D&lt;/td&gt;
&lt;td&gt;500&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;M&lt;/td&gt;
&lt;td&gt;1000&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;A roman numeral has the following properties: &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;It is written from left to right in descending order.&lt;br&gt;
&lt;strong&gt;Example&lt;/strong&gt; : 2 is written as 'II' which is 'I'+'I' or 1+1, 6 is written as 'VI' which is 'V'+'I' or 5+1.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;A character cannot be repeated four times in succession. Subtraction notation is used to represent such instances.&lt;br&gt;
&lt;strong&gt;Example&lt;/strong&gt; : 4 is not written as 'IIII', rather it is written as 'IV'. In this case 'I' is written before 'V' which denotes 'I' should be subtracted from 'V' i.e., 'V'-'I'(5-1=4).&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;There are 6 instances where subtraction notation is used:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;'I' is placed before 'V'(5) to make 'IV'(4).&lt;/li&gt;
&lt;li&gt;'I' is placed before 'X'(10) to make 'IX'(9).&lt;/li&gt;
&lt;li&gt;'X' is placed before 'L'(50) to make 'XL'(40).&lt;/li&gt;
&lt;li&gt;'X' is placed before 'C'(100) to make 'XC'(90).&lt;/li&gt;
&lt;li&gt;'C' is placed before 'D'(500) to make 'CD'(400).&lt;/li&gt;
&lt;li&gt;'C' is placed before 'M'(1000) to make 'CM'(900).&lt;/li&gt;
&lt;/ul&gt;




&lt;h1&gt;
  
  
  Examples
&lt;/h1&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Input&lt;/th&gt;
&lt;th&gt;Output&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;II&lt;/td&gt;
&lt;td&gt;2&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;XL&lt;/td&gt;
&lt;td&gt;40&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;MCMXCVI&lt;/td&gt;
&lt;td&gt;1996&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;




&lt;h1&gt;
  
  
  Solution
&lt;/h1&gt;

&lt;h3&gt;
  
  
  Algorithm:
&lt;/h3&gt;

&lt;ol&gt;
&lt;li&gt;Iterate through each symbol/character in Roman numeral string starting from index 0.&lt;/li&gt;
&lt;li&gt;Get corresponding integer value of the current symbol. &lt;/li&gt;
&lt;li&gt;If current value of symbol is greater than next value of symbol, then add this value to the total result.
Else, subtract the current symbol value from the total result, if the next symbol value is less than 10 times the current value.
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight csharp"&gt;&lt;code&gt;&lt;span class="k"&gt;using&lt;/span&gt; &lt;span class="nn"&gt;System&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="k"&gt;public&lt;/span&gt; &lt;span class="k"&gt;class&lt;/span&gt; &lt;span class="nc"&gt;RomanToDecimal&lt;/span&gt;
&lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="k"&gt;private&lt;/span&gt; &lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="nf"&gt;GetIntegerValue&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kt"&gt;char&lt;/span&gt; &lt;span class="n"&gt;symbol&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="k"&gt;switch&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;symbol&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
        &lt;span class="p"&gt;{&lt;/span&gt;
            &lt;span class="k"&gt;case&lt;/span&gt; &lt;span class="sc"&gt;'I'&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
                &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="m"&gt;1&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
            &lt;span class="k"&gt;case&lt;/span&gt; &lt;span class="sc"&gt;'V'&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
                &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="m"&gt;5&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
            &lt;span class="k"&gt;case&lt;/span&gt; &lt;span class="sc"&gt;'X'&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
                &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="m"&gt;10&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
            &lt;span class="k"&gt;case&lt;/span&gt; &lt;span class="sc"&gt;'L'&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
                &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="m"&gt;50&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
            &lt;span class="k"&gt;case&lt;/span&gt; &lt;span class="sc"&gt;'C'&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
                &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="m"&gt;100&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
            &lt;span class="k"&gt;case&lt;/span&gt; &lt;span class="sc"&gt;'D'&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
                &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="m"&gt;500&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
            &lt;span class="k"&gt;case&lt;/span&gt; &lt;span class="sc"&gt;'M'&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
                &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="m"&gt;1000&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
            &lt;span class="k"&gt;default&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="p"&gt;-&lt;/span&gt;&lt;span class="m"&gt;1&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
        &lt;span class="p"&gt;}&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;

    &lt;span class="k"&gt;private&lt;/span&gt; &lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="nf"&gt;Convert&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kt"&gt;string&lt;/span&gt; &lt;span class="n"&gt;roman&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="kt"&gt;var&lt;/span&gt; &lt;span class="n"&gt;sum&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="m"&gt;0&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
        &lt;span class="k"&gt;for&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kt"&gt;var&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="m"&gt;0&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="n"&gt;roman&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;Length&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;++)&lt;/span&gt;
        &lt;span class="p"&gt;{&lt;/span&gt;
            &lt;span class="kt"&gt;var&lt;/span&gt; &lt;span class="n"&gt;current&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;GetIntegerValue&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;roman&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;]);&lt;/span&gt;
            &lt;span class="k"&gt;if&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;current&lt;/span&gt; &lt;span class="p"&gt;==&lt;/span&gt; &lt;span class="p"&gt;-&lt;/span&gt;&lt;span class="m"&gt;1&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
                &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="p"&gt;-&lt;/span&gt;&lt;span class="m"&gt;1&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

            &lt;span class="k"&gt;if&lt;/span&gt;&lt;span class="p"&gt;((&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;+&lt;/span&gt;&lt;span class="m"&gt;1&lt;/span&gt;&lt;span class="p"&gt;)&amp;lt;&lt;/span&gt;&lt;span class="n"&gt;roman&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;Length&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
            &lt;span class="p"&gt;{&lt;/span&gt;
                &lt;span class="kt"&gt;var&lt;/span&gt; &lt;span class="n"&gt;next&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;GetIntegerValue&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;roman&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;+&lt;/span&gt;&lt;span class="m"&gt;1&lt;/span&gt;&lt;span class="p"&gt;]);&lt;/span&gt;
                &lt;span class="k"&gt;if&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;next&lt;/span&gt; &lt;span class="p"&gt;==&lt;/span&gt; &lt;span class="p"&gt;-&lt;/span&gt;&lt;span class="m"&gt;1&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
                    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="p"&gt;-&lt;/span&gt;&lt;span class="m"&gt;1&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

                &lt;span class="k"&gt;if&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;next&lt;/span&gt; &lt;span class="p"&gt;&amp;gt;&lt;/span&gt; &lt;span class="n"&gt;current&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
                &lt;span class="p"&gt;{&lt;/span&gt;
                    &lt;span class="k"&gt;if&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;next&lt;/span&gt; &lt;span class="p"&gt;&amp;gt;&lt;/span&gt; &lt;span class="m"&gt;10&lt;/span&gt;&lt;span class="p"&gt;*&lt;/span&gt;&lt;span class="n"&gt;current&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
                        &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="p"&gt;-&lt;/span&gt;&lt;span class="m"&gt;1&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

                    &lt;span class="n"&gt;sum&lt;/span&gt; &lt;span class="p"&gt;-=&lt;/span&gt; &lt;span class="n"&gt;current&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
                    &lt;span class="k"&gt;continue&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
                &lt;span class="p"&gt;}&lt;/span&gt;
            &lt;span class="p"&gt;}&lt;/span&gt;
            &lt;span class="n"&gt;sum&lt;/span&gt;&lt;span class="p"&gt;+=&lt;/span&gt;&lt;span class="n"&gt;current&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
        &lt;span class="p"&gt;}&lt;/span&gt;
        &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="n"&gt;sum&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;

    &lt;span class="k"&gt;public&lt;/span&gt; &lt;span class="k"&gt;static&lt;/span&gt; &lt;span class="k"&gt;void&lt;/span&gt; &lt;span class="nf"&gt;Main&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kt"&gt;string&lt;/span&gt;&lt;span class="p"&gt;[]&lt;/span&gt; &lt;span class="n"&gt;args&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="kt"&gt;var&lt;/span&gt; &lt;span class="n"&gt;obj&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nf"&gt;RomanToDecimal&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;

        &lt;span class="kt"&gt;var&lt;/span&gt; &lt;span class="n"&gt;input&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="kt"&gt;string&lt;/span&gt;&lt;span class="p"&gt;[]&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="s"&gt;"II"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s"&gt;"XL"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s"&gt;"MCMXCVI"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s"&gt;"XD"&lt;/span&gt;&lt;span class="p"&gt;};&lt;/span&gt;
        &lt;span class="k"&gt;foreach&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kt"&gt;string&lt;/span&gt; &lt;span class="n"&gt;s&lt;/span&gt; &lt;span class="k"&gt;in&lt;/span&gt; &lt;span class="n"&gt;input&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
        &lt;span class="p"&gt;{&lt;/span&gt;
           &lt;span class="kt"&gt;var&lt;/span&gt; &lt;span class="n"&gt;result&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="n"&gt;obj&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;Convert&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;s&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt; 
           &lt;span class="k"&gt;if&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;result&lt;/span&gt; &lt;span class="p"&gt;==&lt;/span&gt; &lt;span class="p"&gt;-&lt;/span&gt;&lt;span class="m"&gt;1&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
                &lt;span class="n"&gt;Console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;WriteLine&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"Please input a valid Roman Numeral"&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
           &lt;span class="k"&gt;else&lt;/span&gt; &lt;span class="n"&gt;Console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;WriteLine&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"Integer Value For "&lt;/span&gt;&lt;span class="p"&gt;+&lt;/span&gt;&lt;span class="n"&gt;s&lt;/span&gt;&lt;span class="p"&gt;+&lt;/span&gt;&lt;span class="s"&gt;" is : "&lt;/span&gt;&lt;span class="p"&gt;+&lt;/span&gt;&lt;span class="n"&gt;result&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
        &lt;span class="p"&gt;}&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Thank You. Follow for more such content 😃 💻.&lt;/p&gt;

</description>
      <category>csharp</category>
      <category>programming</category>
      <category>leetcode</category>
    </item>
  </channel>
</rss>
