diff --git a/c++ graphics/Basic Graphic Programming in C++ 16e929a92d1c44e58fd51cd6fbff099f.md b/c++ graphics/Basic Graphic Programming in C++ 16e929a92d1c44e58fd51cd6fbff099f.md new file mode 100644 index 0000000..d76a897 --- /dev/null +++ b/c++ graphics/Basic Graphic Programming in C++ 16e929a92d1c44e58fd51cd6fbff099f.md @@ -0,0 +1,87 @@ +# Basic Graphic Programming in C++ + + + +### What is graphics.h exactly? + +**graphics.h** library is used to include and facilitate graphical operations in program. graphics.h functions can be used to draw different shapes, display text in different fonts, change colors and many more. Using functions of graphics.h you can make graphics programs, animations, projects and games. You can draw circles, lines, rectangles, bars and many other geometrical figures. You can change their colors using the available functions and fill them. + +### **As mentioned earlier the header file “graphics.h” contains functions which some of them are described below:** + +- `int initwindow (int width, int height, const char* title, int left, int top)` + + In order to generate a Viewport or a window for drawing graphics shapes, we should use a function called initwindow() + + - **int width:** width of the created window in pixels (integer type) + - **int height:** height of the created window in pixels (integer type) + - **const char* title: t**he title of the generated window which is a string type with dynamic and fixed memory allocation + - **int left:** the horizontal (X) position of the window on the screen (integer type) + - **int top:** the longitudinal (Y) position of the window on the screen (integer type) + + `initwindow (400 ,400, "Viewport" ,300 ,200);` + +- `putpixel(int x, int y)` + + This function is used to draw a dot in (x, y) position. + +- `line(int x1, int y1, int x2, int y2);` + + Line function is used to draw a line from a point (x1, y1) to point (x2, y2). (x1, y1) and (x2, y2) are end points of the line. + +- `circle(int x, int y, int radius);` + + Circle function is used to draw a circle with center (x, y) and radius specified in the third parameter. + +- `rectangle (int left, int top, int right, int bottom);` + + To create a rectangle, you have to pass the four parameters in this function. The two parameters represent the left and top upper left corner. Similarly, the right bottom parameter represents the lower right corner of the rectangle. + +- `outtextxy(int x, int y, char *string);` + + This function displays the text or string at a specified point (x, y) on the screen. + . + +- `setcolor(int color);` + + setcolor sets the current drawing color to a new color. In graphics, each color is assigned a number. Total number of colors available are 16. Number of available colors depends on current graphics mode and driver. For example, setcolor(RED) or setcolor(4) changes the current drawing color to RED. (default drawing color is WHITE) The Colors table is given below: + + | Color | Int values | + | --- | --- | + | BLACK | 0 | + | BLUE | 1 | + | GREEN | 2 | + | CYAN | 3 | + | RED | 4 | + | MAGENTA | 5 | + | BROWN | 6 | + | LIGHTGRAY | 7 | + | DARKGRAY | 8 | + | LIGHTBLUE | 9 | + | LIGHTGREEN | 10 | + | LIGHTCYAN | 11 | + | LIGHRED | 12 | + | LIGHTMAGENTA | 13 | + | YELLOW | 14 | + | WHITE | 15 | +- `setfillstyle(int pattern, int color);` + + This ****function sets the current fill pattern and fill color. The table of colors has already mentioned; below is the table showing INT VALUES corresponding to Patterns: + + | Pattern | Int values | + | --- | --- | + | EMPTY_FILL | 0 | + | SOLID_FILL | 1 | + | LINE_FILL | 2 | + | LTSLASH_FILL | 3 | + | SLASH_FILL | 4 | + | BKSLASH_FILL | 5 | + | LTBKSLASH_FILL | 6 | + | HATCH_FILL | 7 | + | XHATCH_FILL | 8 | + | INTERLEAVE_FILL | 9 | + | WIDE_DOT_FILL | 10 | + | CLOSE_DOT_FILL | 11 | + | USER_FILL | 12 | \ No newline at end of file diff --git a/django_practiceEnglish_app/PracticeEnglish/__init__.py b/django_practiceEnglish_app/PracticeEnglish/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/django_practiceEnglish_app/PracticeEnglish/__pycache__/__init__.cpython-310.pyc b/django_practiceEnglish_app/PracticeEnglish/__pycache__/__init__.cpython-310.pyc new file mode 100644 index 0000000..f6730a9 Binary files /dev/null and b/django_practiceEnglish_app/PracticeEnglish/__pycache__/__init__.cpython-310.pyc differ diff --git a/django_practiceEnglish_app/PracticeEnglish/__pycache__/admin.cpython-310.pyc b/django_practiceEnglish_app/PracticeEnglish/__pycache__/admin.cpython-310.pyc new file mode 100644 index 0000000..6f931dc Binary files /dev/null and b/django_practiceEnglish_app/PracticeEnglish/__pycache__/admin.cpython-310.pyc differ diff --git a/django_practiceEnglish_app/PracticeEnglish/__pycache__/apps.cpython-310.pyc b/django_practiceEnglish_app/PracticeEnglish/__pycache__/apps.cpython-310.pyc new file mode 100644 index 0000000..8e3fa6b Binary files /dev/null and b/django_practiceEnglish_app/PracticeEnglish/__pycache__/apps.cpython-310.pyc differ diff --git a/django_practiceEnglish_app/PracticeEnglish/__pycache__/models.cpython-310.pyc b/django_practiceEnglish_app/PracticeEnglish/__pycache__/models.cpython-310.pyc new file mode 100644 index 0000000..155d517 Binary files /dev/null and b/django_practiceEnglish_app/PracticeEnglish/__pycache__/models.cpython-310.pyc differ diff --git a/django_practiceEnglish_app/PracticeEnglish/__pycache__/urls.cpython-310.pyc b/django_practiceEnglish_app/PracticeEnglish/__pycache__/urls.cpython-310.pyc new file mode 100644 index 0000000..63f34c5 Binary files /dev/null and b/django_practiceEnglish_app/PracticeEnglish/__pycache__/urls.cpython-310.pyc differ diff --git a/django_practiceEnglish_app/PracticeEnglish/__pycache__/views.cpython-310.pyc b/django_practiceEnglish_app/PracticeEnglish/__pycache__/views.cpython-310.pyc new file mode 100644 index 0000000..891a55f Binary files /dev/null and b/django_practiceEnglish_app/PracticeEnglish/__pycache__/views.cpython-310.pyc differ diff --git a/django_practiceEnglish_app/PracticeEnglish/admin.py b/django_practiceEnglish_app/PracticeEnglish/admin.py new file mode 100644 index 0000000..7bc1085 --- /dev/null +++ b/django_practiceEnglish_app/PracticeEnglish/admin.py @@ -0,0 +1,13 @@ +from django.contrib import admin +from .models import * +admin.site.register(example) +admin.site.register(verb_court) +admin.site.register(verb_restaurant) +admin.site.register(verb_airport) +admin.site.register(verb_hotel) +admin.site.register(phrase_say) +admin.site.register(phrase_off) +admin.site.register(phrase_afraid) +admin.site.register(new_thing_me_too) +admin.site.register(new_thing_ithink) +admin.site.register(new_thing_very) diff --git a/django_practiceEnglish_app/PracticeEnglish/apps.py b/django_practiceEnglish_app/PracticeEnglish/apps.py new file mode 100644 index 0000000..ff48670 --- /dev/null +++ b/django_practiceEnglish_app/PracticeEnglish/apps.py @@ -0,0 +1,6 @@ +from django.apps import AppConfig + + +class PracticeenglishConfig(AppConfig): + default_auto_field = 'django.db.models.BigAutoField' + name = 'PracticeEnglish' diff --git a/django_practiceEnglish_app/PracticeEnglish/form.py b/django_practiceEnglish_app/PracticeEnglish/form.py new file mode 100644 index 0000000..97f8439 --- /dev/null +++ b/django_practiceEnglish_app/PracticeEnglish/form.py @@ -0,0 +1,10 @@ +# from django.forms import ModelForm +# from django import forms +# from .models import * + +# class uoload_verb_court(ModelForm): +# verb=forms.TextInput() +# meaning=forms.TextInput() +# class Meta: +# model=verb_court +# fields=["verb", "meaning"] \ No newline at end of file diff --git a/django_practiceEnglish_app/PracticeEnglish/migrations/0001_initial.py b/django_practiceEnglish_app/PracticeEnglish/migrations/0001_initial.py new file mode 100644 index 0000000..e6592aa --- /dev/null +++ b/django_practiceEnglish_app/PracticeEnglish/migrations/0001_initial.py @@ -0,0 +1,95 @@ +# Generated by Django 4.1.3 on 2022-11-23 07:47 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + initial = True + + dependencies = [ + ] + + operations = [ + migrations.CreateModel( + name='example', + fields=[ + ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), + ('name', models.CharField(max_length=30)), + ('meaning', models.CharField(max_length=30)), + ('example', models.CharField(max_length=500)), + ], + ), + migrations.CreateModel( + name='new_thing_ithink', + fields=[ + ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), + ('new', models.CharField(max_length=30)), + ('example', models.CharField(max_length=60)), + ], + ), + migrations.CreateModel( + name='new_thing_me_too', + fields=[ + ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), + ('new', models.CharField(max_length=30)), + ('example', models.CharField(max_length=60)), + ], + ), + migrations.CreateModel( + name='phrase_afraid', + fields=[ + ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), + ('phrase', models.CharField(max_length=30)), + ('meaning', models.CharField(max_length=30)), + ], + ), + migrations.CreateModel( + name='phrase_off', + fields=[ + ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), + ('phrase', models.CharField(max_length=30)), + ('meaning', models.CharField(max_length=30)), + ], + ), + migrations.CreateModel( + name='phrase_say', + fields=[ + ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), + ('phrase', models.CharField(max_length=30)), + ('meaning', models.CharField(max_length=30)), + ], + ), + migrations.CreateModel( + name='verb_airport', + fields=[ + ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), + ('verb', models.CharField(max_length=30)), + ('meaning', models.CharField(max_length=30)), + ], + ), + migrations.CreateModel( + name='verb_court', + fields=[ + ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), + ('verb', models.CharField(max_length=30)), + ('meaning', models.CharField(max_length=30)), + ], + ), + migrations.CreateModel( + name='verb_hotel', + fields=[ + ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), + ('verb', models.CharField(max_length=30)), + ('meaning', models.CharField(max_length=60)), + ], + ), + migrations.CreateModel( + name='verb_restaurant', + fields=[ + ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), + ('verb', models.CharField(max_length=30)), + ('meaning', models.CharField(max_length=30)), + ], + ), + ] diff --git a/django_practiceEnglish_app/PracticeEnglish/migrations/0002_remove_new_thing_ithink_example.py b/django_practiceEnglish_app/PracticeEnglish/migrations/0002_remove_new_thing_ithink_example.py new file mode 100644 index 0000000..39e8b98 --- /dev/null +++ b/django_practiceEnglish_app/PracticeEnglish/migrations/0002_remove_new_thing_ithink_example.py @@ -0,0 +1,17 @@ +# Generated by Django 4.1.3 on 2022-11-23 10:07 + +from django.db import migrations + + +class Migration(migrations.Migration): + + dependencies = [ + ('PracticeEnglish', '0001_initial'), + ] + + operations = [ + migrations.RemoveField( + model_name='new_thing_ithink', + name='example', + ), + ] diff --git a/django_practiceEnglish_app/PracticeEnglish/migrations/0003_new_thing_very.py b/django_practiceEnglish_app/PracticeEnglish/migrations/0003_new_thing_very.py new file mode 100644 index 0000000..f0bfe6d --- /dev/null +++ b/django_practiceEnglish_app/PracticeEnglish/migrations/0003_new_thing_very.py @@ -0,0 +1,21 @@ +# Generated by Django 4.1.3 on 2022-11-23 10:18 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('PracticeEnglish', '0002_remove_new_thing_ithink_example'), + ] + + operations = [ + migrations.CreateModel( + name='new_thing_very', + fields=[ + ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), + ('new', models.CharField(max_length=30)), + ('example', models.CharField(max_length=60)), + ], + ), + ] diff --git a/django_practiceEnglish_app/PracticeEnglish/migrations/__init__.py b/django_practiceEnglish_app/PracticeEnglish/migrations/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/django_practiceEnglish_app/PracticeEnglish/migrations/__pycache__/0001_initial.cpython-310.pyc b/django_practiceEnglish_app/PracticeEnglish/migrations/__pycache__/0001_initial.cpython-310.pyc new file mode 100644 index 0000000..13da55f Binary files /dev/null and b/django_practiceEnglish_app/PracticeEnglish/migrations/__pycache__/0001_initial.cpython-310.pyc differ diff --git a/django_practiceEnglish_app/PracticeEnglish/migrations/__pycache__/0002_remove_new_thing_ithink_example.cpython-310.pyc b/django_practiceEnglish_app/PracticeEnglish/migrations/__pycache__/0002_remove_new_thing_ithink_example.cpython-310.pyc new file mode 100644 index 0000000..9b4ac91 Binary files /dev/null and b/django_practiceEnglish_app/PracticeEnglish/migrations/__pycache__/0002_remove_new_thing_ithink_example.cpython-310.pyc differ diff --git a/django_practiceEnglish_app/PracticeEnglish/migrations/__pycache__/0003_new_thing_very.cpython-310.pyc b/django_practiceEnglish_app/PracticeEnglish/migrations/__pycache__/0003_new_thing_very.cpython-310.pyc new file mode 100644 index 0000000..cbf7624 Binary files /dev/null and b/django_practiceEnglish_app/PracticeEnglish/migrations/__pycache__/0003_new_thing_very.cpython-310.pyc differ diff --git a/django_practiceEnglish_app/PracticeEnglish/migrations/__pycache__/__init__.cpython-310.pyc b/django_practiceEnglish_app/PracticeEnglish/migrations/__pycache__/__init__.cpython-310.pyc new file mode 100644 index 0000000..e90082c Binary files /dev/null and b/django_practiceEnglish_app/PracticeEnglish/migrations/__pycache__/__init__.cpython-310.pyc differ diff --git a/django_practiceEnglish_app/PracticeEnglish/models.py b/django_practiceEnglish_app/PracticeEnglish/models.py new file mode 100644 index 0000000..719cbd0 --- /dev/null +++ b/django_practiceEnglish_app/PracticeEnglish/models.py @@ -0,0 +1,83 @@ +from django.db import models + +class example(models.Model): + name = models.CharField(max_length=30) + meaning = models.CharField(max_length=30) + example = models.CharField(max_length=500) + + def __str__ (self): + return self.name + +class phrase_say(models.Model): + phrase = models.CharField(max_length=30) + meaning = models.CharField(max_length=30) + #example = models.CharField(max_length=500) + + def __str__ (self): + return self.phrase +class phrase_off(models.Model): + phrase = models.CharField(max_length=30) + meaning = models.CharField(max_length=30) + #example = models.CharField(max_length=500) + + def __str__ (self): + return self.phrase +class phrase_afraid(models.Model): + phrase = models.CharField(max_length=30) + meaning = models.CharField(max_length=30) + #example = models.CharField(max_length=500) + + def __str__ (self): + return self.phrase + +class verb_court(models.Model): + verb = models.CharField(max_length=30) + meaning = models.CharField(max_length=30) + #example = models.CharField(max_length=500) + + def __str__ (self): + return self.verb +class verb_restaurant(models.Model): + verb = models.CharField(max_length=30) + meaning = models.CharField(max_length=30) + #example = models.CharField(max_length=500) + + def __str__ (self): + return self.verb +class verb_airport(models.Model): + verb = models.CharField(max_length=30) + meaning = models.CharField(max_length=30) + #example = models.CharField(max_length=500) + + def __str__ (self): + return self.verb +class verb_hotel(models.Model): + verb = models.CharField(max_length=30) + meaning = models.CharField(max_length=60) + #example = models.CharField(max_length=500) + + def __str__ (self): + return self.verb + + +class new_thing_me_too(models.Model): + new = models.CharField(max_length=30) + example = models.CharField(max_length=60) + # instead = models.CharField(max_length=1000) + + def __str__ (self): + return self.new +class new_thing_ithink(models.Model): + new = models.CharField(max_length=30) + # example = models.CharField(max_length=60) + # instead = models.CharField(max_length=1000) + + def __str__ (self): + return self.new +class new_thing_very(models.Model): + new = models.CharField(max_length=30) + example = models.CharField(max_length=60) + # instead = models.CharField(max_length=1000) + + def __str__ (self): + return self.new \ No newline at end of file diff --git a/django_practiceEnglish_app/PracticeEnglish/static/PracticeEnglish/main.css b/django_practiceEnglish_app/PracticeEnglish/static/PracticeEnglish/main.css new file mode 100644 index 0000000..7a62d6a --- /dev/null +++ b/django_practiceEnglish_app/PracticeEnglish/static/PracticeEnglish/main.css @@ -0,0 +1,84 @@ +body { + background: #1b1b1b; + color: #333333; + margin-top: 5rem; + } + + h1, h2, h3, h4, h5, h6 { + color: #444444; + } + + ul { + margin: 0; + } + + .bg-steel { + background-color: #5f788a; + } + + .site-header .navbar-nav .nav-link { + color: #323232; + } + + .site-header .navbar-nav .nav-link:hover { + color: #1b1b1b; + } + + .site-header .navbar-nav .nav-link.active { + font-weight: 500; + } + + .content-section { + background: #1b1b1b; + padding: 10px 20px; + border: 1px solid #323232; + border-radius: 3px; + margin-bottom: 20px; + } + + .article-title { + color: #444444; + } + + a.article-title:hover { + color: #428bca; + text-decoration: none; + } + + .article-content { + white-space: pre-line; + } + + .article-img { + height: 65px; + width: 65px; + margin-right: 16px; + } + + .article-metadata { + padding-bottom: 1px; + margin-bottom: 4px; + border-bottom: 1px solid #323232 + } + + .article-metadata a:hover { + color: #333; + text-decoration: none; + } + + .article-svg { + width: 25px; + height: 25px; + vertical-align: middle; + } + + .account-img { + height: 125px; + width: 125px; + margin-right: 20px; + margin-bottom: 16px; + } + + .account-heading { + font-size: 2.5rem; + } \ No newline at end of file diff --git a/django_practiceEnglish_app/PracticeEnglish/templates/PracticeEnglish/base.html b/django_practiceEnglish_app/PracticeEnglish/templates/PracticeEnglish/base.html new file mode 100644 index 0000000..26ecc68 --- /dev/null +++ b/django_practiceEnglish_app/PracticeEnglish/templates/PracticeEnglish/base.html @@ -0,0 +1,71 @@ + + +
+ + + + + + + + + +{% if messages %} + {% for message in messages %} + + {% endfor %} +{% endif %} +{% block content %} +{% endblock content %} + + diff --git a/django_practiceEnglish_app/PracticeEnglish/templates/PracticeEnglish/choose_new_thing_group.html b/django_practiceEnglish_app/PracticeEnglish/templates/PracticeEnglish/choose_new_thing_group.html new file mode 100644 index 0000000..315c821 --- /dev/null +++ b/django_practiceEnglish_app/PracticeEnglish/templates/PracticeEnglish/choose_new_thing_group.html @@ -0,0 +1,86 @@ + + + + + +paragraph
+ I think +paragraph
+ Very + + \ No newline at end of file diff --git a/django_practiceEnglish_app/PracticeEnglish/templates/PracticeEnglish/choose_phrase_group.html b/django_practiceEnglish_app/PracticeEnglish/templates/PracticeEnglish/choose_phrase_group.html new file mode 100644 index 0000000..08d70e6 --- /dev/null +++ b/django_practiceEnglish_app/PracticeEnglish/templates/PracticeEnglish/choose_phrase_group.html @@ -0,0 +1,147 @@ + + + + + + + + + + + Phrases with "say" + + + + + + + Phrases with "off" + + + + + + + Phrases with "afraid" + + + + \ No newline at end of file diff --git a/django_practiceEnglish_app/PracticeEnglish/templates/PracticeEnglish/choose_verb_group.html b/django_practiceEnglish_app/PracticeEnglish/templates/PracticeEnglish/choose_verb_group.html new file mode 100644 index 0000000..41e7ec8 --- /dev/null +++ b/django_practiceEnglish_app/PracticeEnglish/templates/PracticeEnglish/choose_verb_group.html @@ -0,0 +1,326 @@ + + + + + +# | +Verb | +Meaning | +Example | +|||||||
---|---|---|---|---|---|---|---|---|---|---|
1 | + {% for example in examples %} ++ {{ example.name }} + | +
+
+
+
+
+
|
+ + {{ example.example }} + | + {% endfor %} +