<?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: Orion</title>
    <description>The latest articles on DEV Community by Orion (@0orion0).</description>
    <link>https://dev.to/0orion0</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%2F465998%2F67777f63-e1a6-4e76-9187-4a65e2e199aa.png</url>
      <title>DEV Community: Orion</title>
      <link>https://dev.to/0orion0</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/0orion0"/>
    <language>en</language>
    <item>
      <title>Hangman Code :P</title>
      <dc:creator>Orion</dc:creator>
      <pubDate>Sat, 02 Jan 2021 10:35:55 +0000</pubDate>
      <link>https://dev.to/0orion0/hangman-code-p-55fo</link>
      <guid>https://dev.to/0orion0/hangman-code-p-55fo</guid>
      <description>&lt;p&gt;My first basic not so good project..&lt;/p&gt;

&lt;p&gt;But I did learn a few things...&lt;/p&gt;

&lt;p&gt;Things I think I'll remember from now on...&lt;br&gt;
json.load() &lt;br&gt;
choice() method (random module)&lt;br&gt;
system() method (os module)&lt;br&gt;
sleep() method (time module)&lt;br&gt;
sort() method for lists&lt;br&gt;
isalpha() method&lt;br&gt;
count() method&lt;br&gt;
index() method&lt;/p&gt;

&lt;p&gt;words.json is a file which consists of words.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;import random
import json
import os
import time

with open("words.json") as words_list:
    words=json.load(words_list)

word=random.choice(words).upper()
chances=5
guesses=list()
g_word='-'*len(word)

while chances&amp;gt;0:
    os.system("clear")
    print("Word: {}".format(g_word))
    print("Guessed Letters: {}".format(' '.join(guesses)))
    print("Chances: {}".format(chances))
    guess=input("Guess a letter: ").upper()

    if not guess.isalpha() or len(guess)!=1 or guess in guesses:
       print("Invalid Input. Try Again.")
       time.sleep(1)
       continue

    guesses.append(guess)
    guesses.sort()

    if guess not in word:
        print("Wrong Guess...")
        chances=chances-1
        time.sleep(1)
        continue

    if guess in word:
        g_word=''.join([letter if letter in guesses else '-' for letter in word])
        print("Right On!")
        time.sleep(0.5)

    if g_word == word:
        print("Word: {}".format(g_word))
        print("You Won!")
        time.sleep(1)
        exit(0)

print("\nYou lost! Better luck next time.")
print("The key was: {}".format(word))
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



</description>
      <category>project</category>
      <category>python</category>
      <category>beginners</category>
    </item>
    <item>
      <title>Single Linked List Using C</title>
      <dc:creator>Orion</dc:creator>
      <pubDate>Sun, 13 Dec 2020 13:26:46 +0000</pubDate>
      <link>https://dev.to/0orion0/single-linked-list-using-c-306g</link>
      <guid>https://dev.to/0orion0/single-linked-list-using-c-306g</guid>
      <description>&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;#include&amp;lt;stdio.h&amp;gt;
#include&amp;lt;stdlib.h&amp;gt;

typedef struct Node
{
    int data;
    struct Node *next;
}node;

node *HEAD=NULL;

//Interface Functions
int insert(int value);
int insert_at(int value,int position);
int remove_at(int position);
int search(int value);
void display();

//Internal Functions
node *new_node(int data,node* link);
void get_input(char str[],int* param);
void respond(char name[],int flag);
int length();

void main()
{
    int choice,value,position,flag=0;

    while(1)
    {
        printf("\t\tSINGLE LINKED LIST OPERATIONS\n");
        printf("1.Insert | 2.Insert at | 3.Remove at | 4.Search | 5.Display | 6.Exit\n");

        get_input("Choice",&amp;amp;choice);

        switch(choice)
        {
            case 1:
                    get_input("Value",&amp;amp;value);
                    flag=insert(value);
                    respond("Insertion",flag);
                    break;
            case 2:
                    get_input("Value",&amp;amp;value);
                    get_input("Position",&amp;amp;position);
                    flag=insert_at(value,position);
                    respond("Insertion",flag);
                    break;
            case 3:
                    get_input("Position",&amp;amp;position);
                    flag=remove_at(position);
                    respond("Deletion",flag);
                    break;
            case 4:
                    get_input("Value",&amp;amp;value);
                    if (search(value))
                    printf("Element is at position %d.\n\n",search(value));
                    else
                    printf("Element not found.\n\n");
                    break;
            case 5:
                    display();
                    break;
            case 6:
                    exit(0);
            default:
                    printf("Invalid Choice. Try Again.\n\n");
        }
    }
}

//Internal Functions
node *new_node(int value,node *link)
{
    node *temp=(node *)malloc(sizeof(node));
    if(temp==NULL)
    {
        printf("Memory allocation failure.\n\n");
        exit(0);
    }
    temp-&amp;gt;data=value;
    temp-&amp;gt;next=link;
    return temp;
}

void get_input(char str[],int *param)
{
    printf("Enter %s: ",str);
    scanf("%d",param);
}

void respond(char operation[],int flag)
{   
    if(flag)
    printf("%s Successful.\n\n",operation);
    else
    printf("%s not Successful.\n\n",operation);
}

int length()
{
    int size;
    node *temp=HEAD;
    if(HEAD==NULL)
    return 0;
    for(size=1;temp-&amp;gt;next!=NULL;size++)
    temp=temp-&amp;gt;next;
    return size;
}

//Interface Functions
int insert(int value)
{
    node *new=new_node(value,NULL);
    node *temp=HEAD;

    if (HEAD==NULL)
    {
        HEAD=new;
        return 1;
    }
    else
    {
        while(temp-&amp;gt;next!=NULL)
        temp=temp-&amp;gt;next;

        temp-&amp;gt;next=new;
        return 1;
    }
    return 0;
}

int insert_at(int value,int position)
{
    node *new=new_node(value,NULL);
    node *temp=HEAD;


    if (position&amp;gt;length())
    {
        if (length()==0)
        {
            printf("List is empty.\n");
            return 0;
        }
        printf("Position is farther than size of list.\n");
        return 0;
    }

    if (position==1)
    {
        if(HEAD==NULL)
        {
            HEAD=new;
            return 1;
        }

        new-&amp;gt;next=HEAD;
        HEAD=new;
        return 1;
    }

    if(position&amp;lt;=length())
    {
        for(int i=1;i&amp;lt;position-1;i++)
        temp=temp-&amp;gt;next;

        new-&amp;gt;next=temp-&amp;gt;next;
        temp-&amp;gt;next=new;
        return 1;
    }

    return 0;
}

int remove_at(int position)
{
    node *temp=HEAD;
    node *del;

    if (position&amp;lt;=0)
    {
        printf("Invalid Position.\n");
        return 0;
    }

    if (position&amp;gt;length())
    {
        if (length()==0)
        {
            printf("List is empty.\n");
            return 0;
        }
        printf("Position is farther than size of list.\n");
        return 0;
    }

    if (position==1)
    {
        HEAD=HEAD-&amp;gt;next;
        free(temp);
        return 1;
    }

    if (position&amp;lt;=length())
    {
        for(int i=1;i&amp;lt;position-1;i++)
        temp=temp-&amp;gt;next;

        del=temp-&amp;gt;next;
        if (position==length())
        temp-&amp;gt;next=NULL;
        else
        temp-&amp;gt;next=del-&amp;gt;next;
        free(del);
        return 1;
    }

    return 0;
}

int search(int value)
{
    node *temp=HEAD;
    int pos;

    if (HEAD==NULL)
    {
        printf("List is empty.\n");
        return 0;
    }

    for(pos=1;pos&amp;lt;=length();pos++,temp=temp-&amp;gt;next)
    if(temp-&amp;gt;data==value)
    return pos;

    return 0;
}

void display()
{
    node *temp=HEAD;

    if(HEAD==NULL)
    {
        printf("List is Empty.\n\n");
        return;
    }

    while(temp-&amp;gt;next!=NULL)
    {
        printf("%d -&amp;gt; ",temp-&amp;gt;data);
        temp=temp-&amp;gt;next;
    }
    printf("%d.\n\n",temp-&amp;gt;data);

    return;
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



</description>
      <category>computerscience</category>
      <category>programming</category>
      <category>codenewbie</category>
      <category>c</category>
    </item>
    <item>
      <title>Differences...?</title>
      <dc:creator>Orion</dc:creator>
      <pubDate>Thu, 10 Dec 2020 14:00:58 +0000</pubDate>
      <link>https://dev.to/0orion0/differences-3olb</link>
      <guid>https://dev.to/0orion0/differences-3olb</guid>
      <description>&lt;p&gt;Can someone please with simple words tell the difference between &lt;br&gt;
1)Data type and Data Structure ?&lt;br&gt;
2)Data Structure and Abstract Data type ?&lt;/p&gt;

</description>
      <category>help</category>
      <category>discuss</category>
    </item>
  </channel>
</rss>
