[其它语言] 关于编程语言的一些疑问

 
5102 18
东南风 2023-4-4 01:46:22 来自手机 | 显示全部楼层 |阅读模式
①问一下,学过Python的皮毛和HTML能做什么。前端设计?还是其他的什么?
②还有C#也会一点点,现在主要矛盾就是这几种语音容易搞混(对我来说),有没有什么办法可以解决,而且能更好地学习?
③C#与Python比,哪个用来开发游戏更好?以及如何更好地掌握好一门语言?
以上就是我想提出的疑问,希望有大佬愿意帮我解答。
开朗的盟员 2023-4-4 15:36:27 | 显示全部楼层
HTML不仅仅是前端设计,还可以用来......表白,

点评

其实用c++写字符画也行  详情 回复 发表于 2023-4-4 17:47
对的  详情 回复 发表于 2023-4-4 17:46
中国红客——DHN 2023-4-4 17:46:21 来自手机 | 显示全部楼层
开朗的盟员 发表于 2023-4-4 15:36
HTML不仅仅是前端设计,还可以用来......表白,

对的

点评

我们都是正经人啊,正经人......  详情 回复 发表于 2023-4-5 08:25
中国红客——DHN 2023-4-4 17:47:03 来自手机 | 显示全部楼层
开朗的盟员 发表于 2023-4-4 15:36
HTML不仅仅是前端设计,还可以用来......表白,

其实用c++写字符画也行

点评

HTML代码如下,其他人有需要自取,保存为后缀.HTML  详情 回复 发表于 2023-4-5 08:28
生活无律 2023-4-4 20:48:45 | 显示全部楼层
C语言的爱心代码非常适合表白阿巴阿巴
开朗的盟员 2023-4-5 08:25:05 | 显示全部楼层

我们都是正经人啊,正经人......

点评

你......这个意思是,我不是正经人?  详情 回复 发表于 2023-4-5 17:07
开朗的盟员 2023-4-5 08:28:23 | 显示全部楼层
中国红客——DHN 发表于 2023-4-4 17:47
其实用c++写字符画也行

HTML代码如下,其他人有需要自取,保存为后缀.HTML
  1. <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
  2. <HTML>
  3. <HEAD>
  4. <TITLE> New Document </TITLE>
  5. <META NAME="Generator" CONTENT="EditPlus">
  6. <META NAME="Author" CONTENT="">
  7. <META NAME="Keywords" CONTENT="">
  8. <META NAME="Description" CONTENT="">
  9. <style>
  10. html, body {
  11. height: 100%;
  12. padding: 0;
  13. margin: 0;
  14. background: rgba(243, 144, 215, 0.162);
  15. canvas {
  16. position: absolute;
  17. width: 100%;
  18. height: 100%;
  19. </style>
  20. </HEAD>
  21. <BODY>
  22. <canvas id="pinkboard"></canvas>
  23. <script>
  24. /*
  25. * Settings
  26. */
  27. var settings = {
  28. particles: {
  29.   length:   500, // maximum amount of particles
  30.   duration:   2, // particle duration in sec
  31.   velocity: 100, // particle velocity in pixels/sec
  32.   effect: -0.75, // play with this for a nice effect
  33.   size:      30, // particle size in pixels
  34. },
  35. };
  36. /*
  37. * RequestAnimationFrame polyfill by Erik M&#246;ller
  38. */
  39. (function(){var b=0;var c=["ms","moz","webkit","o"];for(var a=0;a<c.length&&!window.requestAnimationFrame;++a){window.requestAnimationFrame=window[c[a]+"RequestAnimationFrame"];window.cancelAnimationFrame=window[c[a]+"CancelAnimationFrame"]||window[c[a]+"CancelRequestAnimationFrame"]}if(!window.requestAnimationFrame){window.requestAnimationFrame=function(h,e){var d=new Date().getTime();var f=Math.max(0,16-(d-b));var g=window.setTimeout(function(){h(d+f)},f);b=d+f;return g}}if(!window.cancelAnimationFrame){window.cancelAnimationFrame=function(d){clearTimeout(d)}}}());
  40. /*
  41. * Point class
  42. */
  43. var Point = (function() {
  44. function Point(x, y) {
  45.   this.x = (typeof x !== 'undefined') ? x : 0;
  46.   this.y = (typeof y !== 'undefined') ? y : 0;
  47. }
  48. Point.prototype.clone = function() {
  49.   return new Point(this.x, this.y);
  50. };
  51. Point.prototype.length = function(length) {
  52.   if (typeof length == 'undefined')
  53.     return Math.sqrt(this.x * this.x + this.y * this.y);
  54.   this.normalize();
  55.   this.x *= length;
  56.   this.y *= length;
  57.   return this;
  58. };
  59. Point.prototype.normalize = function() {
  60.   var length = this.length();
  61.   this.x /= length;
  62.   this.y /= length;
  63.   return this;
  64. };
  65. return Point;
  66. })();
  67. /*
  68. * Particle class
  69. */
  70. var Particle = (function() {
  71. function Particle() {
  72.   this.position = new Point();
  73.   this.velocity = new Point();
  74.   this.acceleration = new Point();
  75.   this.age = 0;
  76. }
  77. Particle.prototype.initialize = function(x, y, dx, dy) {
  78.   this.position.x = x;
  79.   this.position.y = y;
  80.   this.velocity.x = dx;
  81.   this.velocity.y = dy;
  82.   this.acceleration.x = dx * settings.particles.effect;
  83.   this.acceleration.y = dy * settings.particles.effect;
  84.   this.age = 0;
  85. };
  86. Particle.prototype.update = function(deltaTime) {
  87.   this.position.x += this.velocity.x * deltaTime;
  88.   this.position.y += this.velocity.y * deltaTime;
  89.   this.velocity.x += this.acceleration.x * deltaTime;
  90.   this.velocity.y += this.acceleration.y * deltaTime;
  91.   this.age += deltaTime;
  92. };
  93. Particle.prototype.draw = function(context, image) {
  94. function ease(t) {
  95.     return (--t) * t * t + 1;
  96.   }
  97.   var size = image.width * ease(this.age / settings.particles.duration);
  98.   context.globalAlpha = 1 - this.age / settings.particles.duration;
  99.   context.drawImage(image, this.position.x - size / 2, this.position.y - size / 2, size, size);
  100. };
  101. return Particle;
  102. })();
  103. /*
  104. * ParticlePool class
  105. */
  106. var ParticlePool = (function() {
  107. var particles,
  108.     firstActive = 0,
  109.     firstFree   = 0,
  110.     duration    = settings.particles.duration;
  111. function ParticlePool(length) {
  112.   // create and populate particle pool
  113.   particles = new Array(length);
  114.   for (var i = 0; i < particles.length; i++)
  115.     particles[i] = new Particle();
  116. }
  117. ParticlePool.prototype.add = function(x, y, dx, dy) {
  118.   particles[firstFree].initialize(x, y, dx, dy);
  119.   // handle circular queue
  120.   firstFree++;
  121.   if (firstFree   == particles.length) firstFree   = 0;
  122.   if (firstActive == firstFree       ) firstActive++;
  123.   if (firstActive == particles.length) firstActive = 0;
  124. };
  125. ParticlePool.prototype.update = function(deltaTime) {
  126.   var i;
  127.   // update active particles
  128. if (firstActive < firstFree) {
  129.     for (i = firstActive; i < firstFree; i++)
  130.       particles[i].update(deltaTime);
  131.   }
  132. if (firstFree < firstActive) {
  133.     for (i = firstActive; i < particles.length; i++)
  134.       particles[i].update(deltaTime);
  135.     for (i = 0; i < firstFree; i++)
  136.       particles[i].update(deltaTime);
  137.   }
  138.   // remove inactive particles
  139. while (particles[firstActive].age >= duration && firstActive != firstFree) {
  140.     firstActive++;
  141.     if (firstActive == particles.length) firstActive = 0;
  142.   }
  143. };
  144. ParticlePool.prototype.draw = function(context, image) {
  145.   // draw active particles
  146. if (firstActive < firstFree) {
  147.     for (i = firstActive; i < firstFree; i++)
  148.       particles[i].draw(context, image);
  149.   }
  150. if (firstFree < firstActive) {
  151.     for (i = firstActive; i < particles.length; i++)
  152.       particles[i].draw(context, image);
  153.     for (i = 0; i < firstFree; i++)
  154.       particles[i].draw(context, image);
  155.   }
  156. };
  157. return ParticlePool;
  158. })();
  159. /*
  160. * Putting it all together
  161. */
  162. (function(canvas) {
  163. var context = canvas.getContext('2d'),
  164.     particles = new ParticlePool(settings.particles.length),
  165.     particleRate = settings.particles.length / settings.particles.duration, // particles/sec
  166.     time;
  167. // get point on heart with -PI <= t <= PI
  168. function pointOnHeart(t) {
  169.   return new Point(
  170.     160 * Math.pow(Math.sin(t), 3),
  171.     130 * Math.cos(t) - 50 * Math.cos(2 * t) - 20 * Math.cos(3 * t) - 10 * Math.cos(4 * t) + 25
  172.   );
  173. }
  174. // creating the particle image using a dummy canvas
  175. var image = (function() {
  176.   var canvas  = document.createElement('canvas'),
  177.       context = canvas.getContext('2d');
  178.   canvas.width  = settings.particles.size;
  179.   canvas.height = settings.particles.size;
  180.   // helper function to create the path
  181. function to(t) {
  182.     var point = pointOnHeart(t);
  183.     point.x = settings.particles.size / 2 + point.x * settings.particles.size / 350;
  184.     point.y = settings.particles.size / 2 - point.y * settings.particles.size / 350;
  185.     return point;
  186.   }
  187.   // create the path
  188.   context.beginPath();
  189.   var t = -Math.PI;
  190.   var point = to(t);
  191.   context.moveTo(point.x, point.y);
  192. while (t < Math.PI) {
  193.     t += 0.01; // baby steps!
  194.     point = to(t);
  195.     context.lineTo(point.x, point.y);
  196.   }
  197.   context.closePath();
  198.   // create the fill
  199.   context.fillStyle = '#ea80b0';
  200.   context.fill();
  201.   // create the image
  202.   var image = new Image();
  203.   image.src = canvas.toDataURL();
  204.   return image;
  205. })();
  206. // render that thing!
  207. function render() {
  208.   // next animation frame
  209.   requestAnimationFrame(render);
  210.   // update time
  211.   var newTime   = new Date().getTime() / 1000,
  212.       deltaTime = newTime - (time || newTime);
  213.   time = newTime;
  214.   // clear canvas
  215.   context.clearRect(0, 0, canvas.width, canvas.height);
  216.   // create new particles
  217.   var amount = particleRate * deltaTime;
  218. for (var i = 0; i < amount; i++) {
  219.     var pos = pointOnHeart(Math.PI - 2 * Math.PI * Math.random());
  220.     var dir = pos.clone().length(settings.particles.velocity);
  221.     particles.add(canvas.width / 2 + pos.x, canvas.height / 2 - pos.y, dir.x, -dir.y);
  222.   }
  223.   // update and draw particles
  224.   particles.update(deltaTime);
  225.   particles.draw(context, image);
  226. }
  227. // handle (re-)sizing of the canvas
  228. function onResize() {
  229.   canvas.width  = canvas.clientWidth;
  230.   canvas.height = canvas.clientHeight;
  231. }
  232. window.onresize = onResize;
  233. // delay rendering bootstrap
  234. setTimeout(function() {
  235.   onResize();
  236.   render();
  237. }, 10);
  238. })(document.getElementById('pinkboard'));
  239. </script>
  240. </BODY>
  241. </HTML>
复制代码
生活无律 2023-4-5 17:07:26 | 显示全部楼层
开朗的盟员 发表于 2023-4-5 08:25
我们都是正经人啊,正经人......

你......这个意思是,我不是正经人?

点评

那当然不是,你也是我们  详情 回复 发表于 2023-4-5 18:14
北执 2023-4-5 17:26:38 来自手机 | 显示全部楼层
好好学习天天向上
开朗的盟员 2023-4-5 18:14:00 来自手机 | 显示全部楼层
生活无律 发表于 2023-4-5 17:07
你......这个意思是,我不是正经人?

那当然不是,你也是我们
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

东南风

初入联盟

关注
  • 1
    主题
  • 0
    粉丝
  • 0
    关注
这家伙很懒,什么都没留下!

中国红客联盟公众号

联系站长QQ:5520533

admin@chnhonker.com
Copyright © 2001-2025 Discuz Team. Powered by Discuz! X3.5 ( 粤ICP备13060014号 )|天天打卡 本站已运行